做题技巧
Allen_0526
一个菜的不能再菜的研究僧。。。
展开
-
离散化
离散化,把无限空间中有限的个体映射到有限的空间中去,以此提高算法的时空效率。使用的函数:unique()函数:unique的作用是“去掉”容器中相邻元素的重复元素(不一定要求数组有序,可以先sort一下),它会把重复的元素添加到容器末尾(所以数组大小并没有改变),而返回值是去重之后的尾地址,由于返回的是容器末尾,所以如果想得到去重后的size,需要减去初始地址。upper_bound ...原创 2018-07-18 14:48:57 · 153 阅读 · 0 评论 -
与7无关的数(前缀和)
前缀和: 一个正整数,如果它能被7整除,或者它的十进制表示法中某个位数上的数字为7,则称其为与7相关的数。求所有小于等于N的与7无关的正整数的平方和。例如:N = 8,<= 8与7无关的数包括:1 2 3 4 5 6 8,平方和为:155。Input第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= 1000) 第2 - T + 1行:每...原创 2018-07-18 15:16:34 · 1297 阅读 · 0 评论 -
Reversing Encryption(Reverse函数的应用)
A string ss of length nn can be encrypted by the following algorithm:iterate over all divisors of nn in decreasing order (i.e. from nn to 11), for each divisor dd, reverse the substring s[1…d]s[1…d...原创 2018-07-27 16:51:29 · 266 阅读 · 0 评论 -
Month and years
Months and Years ( CodeForces - 899B ) DescriptionEverybody in Russia uses Gregorian calendar. In this calendar there are 31 days in January, 28 or 29 days in February (depending on whether the ...原创 2018-08-02 21:58:34 · 329 阅读 · 0 评论 -
The Bits(找规律)
第七次个人赛Rudolf is on his way to the castle. Before getting into the castle, the security staff asked him a question:Given two binary numbers aa and bb of length nn. How many different ways of swappi...原创 2018-08-22 21:21:05 · 258 阅读 · 0 评论