07 2020 档案

摘要:C 温暖的签到题。找到答案最大的一列即可,因为如果有多列的话,一定可以分为两个行数不变的矩阵,其中一个答案一定不会变坏。我一开始还以为是0/1分数规划 #include <bits/stdc++.h> using namespace std; #define ll long long ll inpu 阅读全文
posted @ 2020-07-29 16:09 _aether 阅读(231) 评论(0) 推荐(1)
摘要:1004 计算取模后的前缀和,并且存到map里,然后每次在map里查找是否有相同的数,有则答案加一,清空前缀和和map,没有则继续往后找。不过要提前把是k的倍数加到答案里,上面遇到0直接结束,清空map,查找下一段。 #include <bits/stdc++.h> using namespace 阅读全文
posted @ 2020-07-29 15:36 _aether 阅读(294) 评论(0) 推荐(0)
摘要:F 温柔的签到题。 注意这里使用c++的ceil函数会有误差,需要自己手动ceil。注意手动ceil的时候可能会爆long long。 #include <bits/stdc++.h> using namespace std; #define ll long long ll input(){ ll 阅读全文
posted @ 2020-07-25 23:39 _aether 阅读(322) 评论(1) 推荐(2)
摘要:1001 并查集。考虑按点权大到小把点插入图中,每次插入点到图中,我们不妨设集合$S$(其中$s_i$为第$i$个集合的权值)为与当前点相连的连通块组成的集合,$w$为当前节点的权值。易得插入一个点得到的新连通块的公式为: \[ \sum^S (s_i-w)+w \] 那么维护集合我们很自然的想到用 阅读全文
posted @ 2020-07-23 23:15 _aether 阅读(272) 评论(0) 推荐(0)
摘要: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=='- 阅读全文
posted @ 2020-07-18 23:57 _aether 阅读(462) 评论(0) 推荐(3)
摘要: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=='- 阅读全文
posted @ 2020-07-13 23:03 _aether 阅读(392) 评论(1) 推荐(1)
摘要: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 阅读全文
posted @ 2020-07-12 23:32 _aether 阅读(445) 评论(0) 推荐(2)
摘要: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 阅读全文
posted @ 2020-07-10 23:36 _aether 阅读(387) 评论(0) 推荐(0)
摘要: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=='- 阅读全文
posted @ 2020-07-03 22:46 _aether 阅读(441) 评论(0) 推荐(0)
摘要: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=='- 阅读全文
posted @ 2020-07-02 22:43 _aether 阅读(240) 评论(0) 推荐(0)