codeforces
codeforces
the animal
这个作者很懒,什么都没留下…
展开
-
Wonderful Coloring - 2
共有N个数字,以及M种颜色,相同数字不能被同一种颜色染色。每种颜色染色的数目相同,在每种颜色染色最多的情况下,将每个数字的染色情况输出。 用pair将数字与其下标,标记在一起。在逐个染色。 #include<bits/stdc++.h> using namespace std; const int maxn=300000; typedef pair<int,int> p; int a[maxn]; int vis[maxn]; int c[maxn]; int main() {原创 2021-07-30 19:43:55 · 212 阅读 · 0 评论 -
Codeforces Round #727 (Div. 2
A 共有n人比赛,每人间隔M分钟开始比赛,每人共比赛k分钟,在此人开始比赛时,尚有未结束比赛的数量为此人不满值,问不满值为多少; 设t=k/m,若t>=n,则是等差数列求n-1,n-2…1的和 反之,则共有n-t组不满值为t,剩余t人不满值仍是等差数列 #include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { int T; scanf("%d",&T); w原创 2021-07-20 09:21:53 · 44 阅读 · 0 评论 -
CodeForces - 1B
将两种形式表示行和列的方法互相转换,R23C55表示55列23行,则可以用BC23表示。A-Z表示1-26,27用AA表示,28用AB表示 Input 2 R23C55 BC23 Output BC23 R23C55 主要就是26进制的转化,A从1开始! #include<bits/stdc++.h> using namespace std; typedef pair<int,int> pill; pill tmp; map<pill,int> mp; string s;原创 2021-06-19 20:53:40 · 131 阅读 · 0 评论 -
Codeforces Round #724 (Div. 2)
C. Diluc and Kaeya 输入一行字符串包含D或者K,可以将其分成几块,也可以不分,求前缀D和K比例相同,做多可以分成几块。 input 5 3 DDK 6 DDDDDD 4 DKDK 1 D 9 DKDKDDDDK output 1 2 1 1 2 3 4 5 6 1 1 1 2 1 1 1 1 2 1 2 1 1 3 求出D和K的比例,将其化简,并记录其出现的次数。 #include<bits/stdc++.h> using namespace std; pair<int,原创 2021-06-17 20:16:58 · 70 阅读 · 0 评论 -
Codeforces Round #723 (Div. 2)
B 数字n,可不可以由11,111,1111,11111……数子组成 例如:33=11+11+11; 大于111的数字可以由111和11组成 #include<bits/stdc++.h> using namespace std; int main() { int p; scanf("%d",&p); while(p--) { int n,i,j,k=10,flog=0; scanf("%d",&n);原创 2021-06-03 20:53:45 · 52 阅读 · 0 评论 -
CodeForces - 1512C和CodeForces - 1512D
CodeForces - 1512C 给一串包含0,1,?的字符串,并给出a,b。可以将字符串中的?改成0或者1.最终使字符串中有 a 个 0,b 个 1 ,并且字符串回文。 用a,b减去原字符串中有多少个0或1,再从两边向中央靠拢; #include<bits/stdc++.h> using namespace std; typedef long long ll; char s[5001212]; int main() { int p; scanf("%d",&p);原创 2021-06-01 21:14:57 · 171 阅读 · 0 评论 -
CodeForces - 1506D和CodeForces - 1497B
CodeForces - 1506D You are given an array a of length n consisting of integers. You can apply the following operation, consisting of several steps, on the array a zero or more times: you select two different numbers in the array ai and aj; you remove i-th原创 2021-06-01 20:45:57 · 139 阅读 · 0 评论