摘要:
C. Mad MAD Sum 手玩规律题,预处理两次就能得到一个规律的答案。 #include<bits/stdc++.h> using namespace std; #define ls(x) (x<<1) #define rs(x) ((x<<1)+1) int read() { int ret 阅读全文
摘要:
B. Turtle and an Infinite Sequence 看到位运算就应该按位考虑的,我想的是按数扩散没想按位扩散最后就大错特错了。。 按位扩散主要是得想到每个p2[i]每隔p2[i]次就会出现一遍。。如果能扩散到就存在。 #include<bits/stdc++.h> #define 阅读全文
摘要:
ab略... C: map嵌套水过去的,复杂度\(nlog^2n\),感觉不如正解 #include<bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define mkp mak 阅读全文
摘要:
input: default input is string num=input() num=int(input())//this can change the input type loop: instead of curly brackets, python identify code bloc 阅读全文
摘要:
ab题没啥好说的,b题一开始看题错成线段树了,后面发现维护最大值就过了(我就说b怎么会有线段树)。。。 C:Dora and C++ 卡的我死死的,好久没卡c了,数论果然是最短板。。。我有两个推论,但是一个都不会用: 1.翡蜀定理。(但是这题只有正数)(处理两个数的情况) 2.断环为链。(但是我只会 阅读全文