
cf题解
文章平均质量分 72
精神小伙mqpm
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Educational Codeforces Round 103 (Rated for Div. 2)
A. K-divisible SumYou are given two integers n and k.You should create an array of n positive integers a1,a2,…,an such that the sum (a1+a2+⋯+an) is divisible by k and maximum element in a is minimum possible.What is the minimum possible maximum element原创 2021-02-05 16:11:50 · 254 阅读 · 0 评论 -
Codeforces Round #699 (Div. 2)
Codeforces Round #699 (Div. 2)A. K-divisible SumYou are given two integers n and k.You should create an array of n positive integers a1,a2,…,an such that the sum (a1+a2+⋯+an) is divisible by k and maximum element in a is minimum possible.What is the m原创 2021-01-31 00:47:04 · 463 阅读 · 0 评论 -
Codeforces Round #697 (Div. 3)
Codeforces Round #697 (Div. 3)A.Odd Divisorint main(){ int N; sd1(N); for(int i = 0; i < N; i++){ LL num; sl1(num); if(num % 2 != 0) cout << "YES" << endl; else{ while(num /= 2){原创 2021-01-29 14:05:05 · 140 阅读 · 0 评论 -
Codeforces Round #674 (Div. 3) A B C D
A. Floor Number题意思路: 位置n, 一层楼x个房间,问再第几层代码:#include<iostream>#include<queue>#include<stack>#include<cstring>#include<stdlib.h>#include<cstdio>#include<iostream>#include<algorithm>#include<map&g原创 2020-09-29 00:36:29 · 247 阅读 · 0 评论 -
cf672
A. Cubes Sorting题意思路:看一下是不是降序即可代码:#include<iostream>#include<queue>#include<stack>#include<cstring>#include<stdlib.h>#include<cstdio>#include<iostream>#include<algorithm>#include<map>#inclu原创 2020-09-26 10:05:36 · 367 阅读 · 0 评论 -
Codeforces Round #667 (Div. 3) D
Decrease the Sum of Digits题意: 将一个数加n使其各位上的数字相加之和小于s思路: 贪心处理,从后向前依次处理,刚开始还想着转化成数组,结果想麻烦了,从后向前处理即可 对于每一位,算一下当前各位数之和是否满足条件,若不满足,加上一个数使其进位即:n += b - n % b; b *= 10; 最后输出与原数之差即可代码:#include<iostream>#include<queue>#include<stack>#inclu原创 2020-09-06 15:59:23 · 248 阅读 · 0 评论 -
Codeforces Round #667 (Div. 3) 题解A-D
A:Yet Another Two Integers Problem提议思路 : 两数之差除10向下取整即可代码:#include<iostream>#include<queue>#include<stack>#include<cstring>#include<stdlib.h>#include<cstdio>#include<iostream>using namespace std;int mai原创 2020-09-05 10:57:18 · 196 阅读 · 0 评论 -
Educational Codeforces Round 93 (Rated for Div. 2)题解ABC
A - Bad Triangle题意思路: 给以数组 找出数组中构不成三角形的元素代码:#include <bits/stdc++.h>using namespace std;int T;int main(){ cin >>T; while(T--){ int n; cin >> n; int a[n]; for(int i = 0; i < n; i++){原创 2020-08-16 15:14:29 · 255 阅读 · 0 评论 -
Codeforces Round #663 (Div. 2)
B fix you题意 : 给一个又R 和D 组成的图 要求从任何一个点出发 都可以到达右下角 求要改的R和D的数目的最小值思路 :只需要把最右边的一列改成D 把最下边的一列改成R 即可代码:#include<bits/stdc++.h>using namespace std;int T;char vis[101][101];int l, w;int main(){ cin >> T; int sum = 0; while(T--){ su原创 2020-08-14 14:45:45 · 145 阅读 · 0 评论 -
Codeforces Round #664 (Div. 2)题解
A Boboniu Likes to Color Balls题意思路 : 给定四种颜色通过以下操作判断能否组成回文串操作: 前三个减一 后一个加一思路 : 判断奇数的个数 若和为奇数 则最多有一个奇数 若为偶数 0个代码:#include<bits/stdc++.h>using namespace std;int c[4];bool f(){ int sum1 = 0; int sum2 = 0; for(int i = 0; i < 4; i++){ sum原创 2020-08-13 18:22:04 · 414 阅读 · 0 评论 -
Codeforces Round #661 (Div. 3)题解ABC
A remove smalles题意思路:将数组排序 看相邻数子之差是否有大于1的#include<bits/stdc++.h>using namespace std;//int a[33][33];int main(){ int T; cin >>T; while(T--){ int n; cin >>n; int a[n]; for(int i = 0; i < n原创 2020-08-06 15:52:05 · 248 阅读 · 0 评论 -
Codeforces Round #660 (Div. 2) A B题解
又又爆零了。。。A nearly primer找最小的三个满足条件的数 6 10 14若小于30 没戏大于三十 剩下的数为 n-30 考虑重复的情况 n-30 等于6 10 15 就取15代码#include<bits/stdc++.h>using namespace std;#define LL long longint T;int n;int main(){ cin >> T; while(T--){ cin >>原创 2020-07-31 10:32:40 · 266 阅读 · 0 评论 -
Codeforces Round #654 (Div. 2) A Bt题解
A水题#include<bits/stdc++.h>using namespace std;#define MAX 1001int a;int T;int main(){ cin >> T; while(T--){ cin >> a; int ans = (a-1) / 2 + 1; printf("%d\n", ans); }}Bwa了好几发发现输入了int应该是LL;#include<bits/stdc++.h>原创 2020-07-29 10:44:08 · 158 阅读 · 0 评论