思维题
SolitaryOrz
ACM最弱传说
展开
-
Codeforces 1247C 【思维】【2的幂】【二进制的特点】
C. p-binary Source Codeforces 1247C p-binary Solution 题意:把2k-p定义为2的k次幂,然后问最少需要多少个2的幂能够构成n. 思路:首先枚举需要多少个2的幂,那么只用2的幂构成的数应该为m = n - i * p,然后判断m最少需要由多少个2的幂组成,把m转换成二进制,有多少个1即需要多少个2的幂组成,只要少于i(因为多余的可以把大拆小,如2...原创 2019-10-27 13:32:54 · 215 阅读 · 0 评论 -
Codeforces 1200C 【水题】
C. Round Corridor Amugae is in a very large round corridor. The corridor consists of two areas. The inner area is equally divided by n sectors, and the outer area is equally divided by m sectors. A wa...原创 2019-08-13 14:32:54 · 360 阅读 · 0 评论 -
Codeforces 1203D2
D2. Remove the Substring (hard version) The only difference between easy and hard versions is the length of the string. You are given a string s and a string t, both consisting only of lowercase Latin...原创 2019-08-15 14:19:05 · 364 阅读 · 1 评论 -
Codeforces 847A 【思维】【模拟】
A. Union of Doubly Linked Lists Doubly linked list is one of the fundamental data structures. A doubly linked list is a sequence of elements, each containing information about the previous and the nex...原创 2019-08-17 00:24:23 · 326 阅读 · 0 评论 -
Codeforces 1194D 【博弈】
D. 1-2-K Game Alice and Bob play a game. There is a paper strip which is divided into n + 1 cells numbered from left to right starting from 0. There is a chip placed in the n-th cell (the last one). P...转载 2019-08-17 16:20:15 · 293 阅读 · 0 评论 -
Codeforces 931E 【字符串】
E. Game with String Vasya and Kolya play a game with a string, using the following rules. Initially, Kolya creates a string s, consisting of small English letters, and uniformly at random chooses an i...原创 2019-09-21 10:51:00 · 128 阅读 · 0 评论 -
Codeforces 1213D2 【思维】
D2. Equalizing by Division (hard version)原创 2019-09-21 17:30:58 · 182 阅读 · 0 评论