【CF Round 434 B. Which floor?】】的更多相关文章

time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are o…
Time limit per test1 second memory limit per test 256 megabytes input standard input output standard output For a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with k or more zeros in base 10 and i…
[链接]h在这里写链接 [题意] 在这里写题意 [题解] 枚举每层有多少个公寓就好. 要注意,每次都要从1到100判断,一下那个公寓该不该出现在那一层. 多个答案,如果答案是一样的.也算是唯一的.  (虽然这时候楼层不唯一) [错的次数] 0 [反思] 在这了写反思 [代码] #include <bits/stdc++.h> using namespace std; const int N = 200; int n, m, cur = 0, idx = 0;; int should[N + 1…
[链接]h在这里写链接 [题意] 给你n个电话号码. 让你给每一个电话号码选定一个字符串s; 使得这个串s是这个电话号码的子串. 且不是任何一个其他电话号码的子串. s要求最短. [题解] 字典树. 每个电话号码,1,2,..length(s)开始的长度为length(s)...3,2,1的子串. 依次从根节点加入到字典树当中去. 然后考虑,一个子串s在另外一个字符串中出现过. 则另外一个字符串,在某个起点开始的子串加入到字典树的过程中,肯定会覆盖到s的路径. (因为s肯定也是从根节点开始加入到…
[链接]h在这里写链接 [题意] 在这里写题意 [题解] 转换一下就是求n和10^k的最小公倍数. [错的次数] 0 [反思] 在这了写反思 [代码] #include <bits/stdc++.h> using namespace std; long long n, k; long long temp; long long gcd(long long a, long long b) { if (b == 0) return a; else return gcd(b, a%b); } int…
[链接]h在这里写链接 [题意] 定义bad list是一个非空的.最大公约数为1的序列.给定一个序列,有两种操作:花费x将一个元素删除.花费y将一个元素加1,问你将这个序列变为good list所需要的最小花费是多少. [题解] 枚举gcd为i. 这里的枚举,并不是说确切这些数字的gcd就是i; 而是枚举这些数的gcd是i的倍数. 这样的话,每个数字都必须是i的倍数. (然后,我们只要贪心地让每个数都变成i的倍数就好了,最近的i的倍数,这样肯定是最优的) (最后gcd到底是多少,并不重要,只要…
本来是rated,现在变成unrated,你说气不气. 链接. [A]k-凑整 题意: 一个正整数\(n\)的\(k\)-凑整数是最小的正整数\(x\)使得\(x\)在十进制下末尾有\(k\)个或更多的\(0\)并且\(n\)整除\(x\). 举个例子:\(375\)的\(4\)-凑整数是\(375\cdot80=30000\).\(30000\)是最小的整数使得末尾有\(4\)个及以上的\(0\),并且能被\(375\)整除. 试求出\(n\)的\(k\)-凑整数. 输入: 一行,两个正整数\…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Leha somehow found an array consisting of n integers. Looking at it, he came up with a task. Two players play the game on the array. Players…
time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Adieu l'ami. Koyomi is helping Oshino, an acquaintance of his, to take care of an open space around the abandoned Eikou Cram School building…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output — This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii-chan! With hands joined, go everywhere a…