07 2020 档案
摘要:C 温暖的签到题。找到答案最大的一列即可,因为如果有多列的话,一定可以分为两个行数不变的矩阵,其中一个答案一定不会变坏。我一开始还以为是0/1分数规划 #include <bits/stdc++.h> using namespace std; #define ll long long ll inpu
阅读全文
摘要:1004 计算取模后的前缀和,并且存到map里,然后每次在map里查找是否有相同的数,有则答案加一,清空前缀和和map,没有则继续往后找。不过要提前把是k的倍数加到答案里,上面遇到0直接结束,清空map,查找下一段。 #include <bits/stdc++.h> using namespace
阅读全文
摘要:F 温柔的签到题。 注意这里使用c++的ceil函数会有误差,需要自己手动ceil。注意手动ceil的时候可能会爆long long。 #include <bits/stdc++.h> using namespace std; #define ll long long ll input(){ ll
阅读全文
摘要:1001 并查集。考虑按点权大到小把点插入图中,每次插入点到图中,我们不妨设集合$S$(其中$s_i$为第$i$个集合的权值)为与当前点相连的连通块组成的集合,$w$为当前节点的权值。易得插入一个点得到的新连通块的公式为: \[ \sum^S (s_i-w)+w \] 那么维护集合我们很自然的想到用
阅读全文
摘要:L 温暖的签到题。 #include <bits/stdc++.h> using namespace std; #define ll long long ll input(){ ll x=0,f=0;char ch=getchar(); while(ch<'0'||ch>'9') f|=ch=='-
阅读全文
摘要:D 温暖的签到题。 #include <bits/stdc++.h> using namespace std; #define ll long long ll input(){ ll x=0,f=0;char ch=getchar(); while(ch<'0'||ch>'9') f|=ch=='-
阅读全文
摘要:F 签到题。 #include <bits/stdc++.h> using namespace std; #define ll long long ll input(){ ll x=0,f=0;char ch=getchar(); while(ch<'0'||ch>'9') f|=ch=='-',c
阅读全文
摘要:H 我们枚举化简后有多少对$x'=\frac{gcd(i,j)}$和$y'=\frac{gcd(i,j)}$,然后就可以得出有多少$gcd(i,j)$满足条件。 #include <bits/stdc++.h> using namespace std; #define ll long long ll
阅读全文
摘要:A 温暖的签到题。 #include <bits/stdc++.h> using namespace std; #define ll long long ll input(){ ll x=0,f=0;char ch=getchar(); while(ch<'0'||ch>'9') f|=ch=='-
阅读全文
摘要:A 温暖的签到题。 #include <bits/stdc++.h> using namespace std; #define ll long long ll input(){ ll x=0,f=0;char ch=getchar(); while(ch<'0'||ch>'9') f|=ch=='-
阅读全文

浙公网安备 33010602011771号