![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
codeforces
文章平均质量分 69
JZK-Keven
退役ACMer
展开
-
codeforce 紫名
紫名原创 2022-07-17 01:42:39 · 500 阅读 · 0 评论 -
Codeforces Round #807 (Div. 2)
Codeforces Round #807 (Div. 2)原创 2022-07-16 01:34:30 · 291 阅读 · 0 评论 -
Codeforces Round #800 (Div. 2)
Codeforces Round #800 (Div. 2)原创 2022-06-25 01:11:46 · 414 阅读 · 0 评论 -
Codeforces Round #633 (Div. 2)
https://codeforces.com/contest/1339/problem/EA - Filling Diamonds考虑 n = 3 的情况,如果我们放红色,只有一种情况,否则有种#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusi...原创 2020-04-13 10:39:32 · 214 阅读 · 0 评论 -
Educational Codeforces Round 85 (Rated for Div. 2)
http://codeforces.com/contest/1334A - Level Statistics阅读理解题。满足第一个数字大于等于第二个数字,第一个数字和第二个数字都递增,第一个数字的增量不能小于第二个数字的增量就是 YES#include <bits/stdc++.h>#define ll long long#define sc scanf#def...原创 2020-04-11 11:33:30 · 274 阅读 · 0 评论 -
Codeforces Round #632 (Div. 2)
http://codeforces.com/contest/1333A - Little Artem左边一列,上面一行放黑色,其他都是白色即可#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusing namespace std;char ans[105][...原创 2020-04-09 08:16:25 · 183 阅读 · 0 评论 -
Codeforces Round #630 (Div. 2)
https://codeforces.com/contest/1332A - Exercising Walk先判一下能不能动,在判越界#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusing namespace std;const int MAXN = 1...原创 2020-04-01 00:06:16 · 266 阅读 · 0 评论 -
Codeforces Round #629 (Div. 3)
https://codeforces.com/contest/1328A - Divisibility Problem记得取模#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusing namespace std;const int MAXN = 2e5 +...原创 2020-03-27 18:57:03 · 350 阅读 · 0 评论 -
Educational Codeforces Round 84 (Rated for Div. 2)
https://codeforces.com/contest/1327A - Sum of Odd Integers将数字 n 分成 k 个互不相等的奇数,首先 n 和 k 对 2 取模要相等,不然不可能分成 k 个奇数,其次考虑 k 个不同的奇数能组成的最小的数字是否大于等于 n 即可#include <bits/stdc++.h>#define ll long lo...原创 2020-03-24 01:34:18 · 370 阅读 · 0 评论 -
Codeforces Global Round 7
https://codeforces.com/contest/1326A - Bad Ugly Numbers输出n位数,使得这个数字不能被它含有的单个数字整除特判掉1,直接输出233-- || 277-- 就可以了,比赛的时候脑残输出了一个 288--,然后整了半天。#include <bits/stdc++.h>#define ll long long#def...原创 2020-03-23 22:30:50 · 377 阅读 · 0 评论 -
Codeforces Round #628 (Div. 2)
https://codeforces.com/contest/1325A - EhAb AnD gCd#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusing namespace std;int main(){ int T; sc("%d", &...原创 2020-03-22 19:45:52 · 203 阅读 · 0 评论 -
Codeforces Round #627 (Div. 3)
A - Yet Another Tetris Problem#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusing namespace std;int a[105];int main(){ int T; sc("%d", &T); while ...原创 2020-03-13 00:53:20 · 329 阅读 · 3 评论 -
Educational Codeforces Round 83 (Rated for Div. 2)
https://codeforces.com/contest/1312A - Two Regular Polygons是否倍数#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusing namespace std;int main(){ int T; ...原创 2020-03-10 11:01:36 · 184 阅读 · 0 评论 -
Codeforces Round #625 (Div. 2, based on Technocup 2020 Final Round)
A - Contest for Robots#include <bits/stdc++.h>#define ll long long #define sc scanf#define pr printfusing namespace std;int a[105], b[105], t, q, w;int main(){ int n; sc("%d", &n...原创 2020-03-02 14:09:14 · 215 阅读 · 0 评论 -
Hello 2020
A - New Year and Naming#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusing namespace std;string a[25], b[25];int main(){ int n, m; sc("%d%d", &n, &...原创 2020-01-06 18:33:22 · 249 阅读 · 0 评论 -
Educational Codeforces Round 77 (Rated for Div. 2)
Educational Codeforces Round 77 (Rated for Div. 2)A - Heating大概就是将个物品要覆盖个位置,每个物品安装的代价是 这个物品覆盖直径的平方。显然平分答案最优。#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr...原创 2019-11-28 13:12:51 · 926 阅读 · 0 评论 -
立flag
寒假之前 codeforces 紫名https://codeforces.com/profile/xiaoshenlongaixuexi原创 2019-11-11 09:26:06 · 224 阅读 · 0 评论 -
Codeforces Round #589 (Div. 2)
A - Distinct Digits#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusing namespace std;bool jzk(int k){ bool vis[10]; memset(vis, 0, sizeof(vis)); while ...原创 2019-09-30 12:33:47 · 243 阅读 · 0 评论 -
Codeforces Round #587 (Div. 3)
A - Prefixes#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusing namespace std;char s[200005];int main(){ int n; sc("%d", &n); sc("%s", s); int an...原创 2019-09-21 18:23:20 · 222 阅读 · 0 评论 -
Educational Codeforces Round 72 (Rated for Div. 2)
A - Creating a Character求出第一个数字的可能的最大值和最小值,减一下就是答案#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusing namespace std;int main(){ int t; sc("%d", &...原创 2019-09-06 18:04:02 · 103 阅读 · 0 评论 -
Codeforces Round #583 (Div. 1 + Div. 2, based on Olympiad of Metropolises)
A - Optimal Currency Exchange跑一个完全背包暴力一下答案。#include <bits/stdc++.h>#define ll long long#define sc scanf#define pr printfusing namespace std;bool dp[100000005];int main(){ ll n, d, e...原创 2019-09-05 13:07:03 · 120 阅读 · 0 评论 -
Codeforces Round #514 (Div. 2)C. Sequence Transformation
【题目链接】题意给你一个n,有1-n共n个数字,每次操作求一下剩余数字的最大公因数,再删去一个数字,执行n次操作。令n次操作的最大公因数排成一个序列,求该序列字典序的最大值Examplesinput3output1 1 3input2output1 2input1output1NoteIn the first sample the answer may be a...原创 2018-10-08 23:26:55 · 248 阅读 · 0 评论 -
Codeforces Round #544 (Div. 3) E. K Balanced Teams
题意:有n个数字,要你分成k组,要求每组内最大值与最小值的差值不超过5。求k组最多可以放多少个数。思路:线性DP,预计算出这个数字作为右端点时取的数字的个数,然后考虑每个数字取或者不取。Code:#include <bits/stdc++.h>using namespace std;int a[5005], b[5005], dp[5005][5005], n...原创 2019-03-14 15:17:44 · 179 阅读 · 0 评论 -
Codeforces 1138B B. Circus
暴力啊,先随便乱分,然后算A和C的差值,然后枚举所有可以让差值变小的两个数进行交换,注意可能会在枚举中陷入死循环,设置一个标记跳出就行。Code:#include <bits/stdc++.h>using namespace std;int a[5005], c[5005], flag[5005];set<int>aa1, cc1, ac1, other1,...原创 2019-03-12 22:20:30 · 220 阅读 · 0 评论 -
Codeforces Round #547 (Div. 3) F2. Same Sum Blocks (Hard)
给定一个数列,求最多有多少个 不相交 并且 区间和相等 的区间。首先枚举左右端点,然后将 n^2 个区间和相等的存到一起,按右端点的大小排序,然后考虑每一组和相等的,贪心选最多有多少个不相交的区间。注意一定要按右端点来排序,如果按照左端点排序的话会错在第28个测试点,比如下面这组数据65 4 -4 3-3-5如果左端点排序的话,他会直接将整个区间加入到sum=0的地方...原创 2019-03-22 09:32:34 · 284 阅读 · 0 评论 -
Codeforces Round #550 (Div. 3) E. Median String
题意:给你两个字符串,保证他们两个之间有奇数个字典序大于第一个,小于第二个字符串的串,求这两个字符串的最中间的字符串。1、考虑先求出两个字符串的差值,然后将差值/2,然后加上第一个字符串。2、中间会出现负数,然后从后往前扫一遍,发现负数向前拿一位消掉负数。3、会爆char类型,提前吧字符串转化为int类型的数字。4、答案 = 差值/2+第一个串。Code:#include...原创 2019-04-10 14:33:40 · 158 阅读 · 0 评论 -
Codeforces Global Round 2 - D. Frets On Fire
http://codeforces.com/contest/1119/problem/D1、每一次询问不考虑重复的话,有个数字,然后考虑有多少个重复的数字,2、将a排序,如果相邻两个端点的差值小于的话,那么可以认定他们一定有重复的值,否则没有重复的值,不进行第三步3、重复元素的个数就是4、所以不重复的元素个数就等于 所有数字减去 重复数字5、注意第四点的公式必须要满足第...原创 2019-04-08 19:46:57 · 196 阅读 · 0 评论 -
Codeforces Round #549 (Div. 2) B. Nirvana
首先我们想到尽量将每一位变为9,然后每次都向前借一位来减。注意当K为0时,表示前面的数字没了,所以应该返回1。#include <bits/stdc++.h>using namespace std;int solve(int k){ //k=0表示前面的数字不存在 if (k == 0) return 1; if (k < 10) return k;...原创 2019-04-03 14:20:59 · 320 阅读 · 0 评论 -
Codeforces Round #552 (Div. 3)
A - Restoring Three Numbers#include <bits/stdc++.h>using namespace std;int a[4];int main(){ for (int i = 0; i < 4; i++) scanf("%d", &a[i]); sort(a, a + 4); printf("%d %d %d", ...原创 2019-04-17 09:42:06 · 113 阅读 · 0 评论 -
蓝名
下一个目标,紫名,以后10点场和11点场的CF(div2,div3)都打原创 2019-04-23 20:27:57 · 454 阅读 · 0 评论 -
Educational Codeforces Round 63 (Rated for Div. 2) D. Beautiful Array
http://codeforces.com/problemset/problem/1155/D表示取到位置出现的和的最大值表示取到位置前半部分的和 & 后半部分的和*k 的和的最大值表示取到位置并且中间有一段区间*k 的和的最大值#include <bits/stdc++.h>#define ll long longusing name...原创 2019-05-29 14:45:01 · 206 阅读 · 0 评论 -
Codeforces Round #560 (Div. 3)
补题记录A. Remainder#include <bits/stdc++.h>using namespace std;int n, m, k;char s[200005];int main(){ scanf("%d%d%d", &n, &m, &k); scanf("%s", s); int ans = 0; for (int i ...原创 2019-06-10 21:14:25 · 175 阅读 · 0 评论 -
Codeforces Round #575 (Div. 3)
A. Three Piles of Candieshttp://codeforces.com/contest/1196/problem/A#include<bits/stdc++.h>#define ll long longusing namespace std;int main(){ int T; scanf("%d", &T); while (T--...原创 2019-07-25 12:01:26 · 154 阅读 · 0 评论 -
Codeforces Round #576 (Div. 2)
http://codeforces.com/contest/1199A、City Day左边X个比他大,右边Y个比他大的左边的数字#include <bits/stdc++.h>using namespace std;int a[1000005];int main(){ int n, x, y; scanf("%d%d%d", &n, &x, ...原创 2019-07-31 09:05:33 · 181 阅读 · 0 评论 -
Educational Codeforces Round 69 (Rated for Div. 2)
A. DIY Wooden Ladder排个序,最长的两根作梯子的腿,然后答案就是 剩余梯子的个数,梯子腿长度-1。#include <bits/stdc++.h>#define ll long longusing namespace std;const ll mod = 1e9 + 7;int a[100005];int main(){ int T; sca...原创 2019-07-23 10:19:58 · 479 阅读 · 0 评论 -
Codeforces Round #580 (Div. 2)
A - Choose Two Numbers选最大的两个数#include <bits/stdc++.h>#define sc scanf#define pr printf#define ll long longusing namespace std;const int MAXN = 200005;int a[200005], b[200005];int mai...原创 2019-08-19 11:20:55 · 348 阅读 · 1 评论 -
Codeforces Round #579 (Div. 3)
http://codeforces.com/contest/1203-------------------------------------------------赛后两分钟,在F1后面加了一个判断,过了。。少了一题血亏A - Circle of Students从左往右,从右往左扫一遍#include <bits/stdc++.h>#define sc sc...原创 2019-08-14 11:54:46 · 470 阅读 · 1 评论 -
Codeforces Round #578 (Div. 2)
A、Hotelier暴力#include<bits/stdc++.h>#define sc scanf#define pr printfusing namespace std;int a[15];int main(){ int n; sc("%d", &n); getchar(); for (int i = 1; i <= n; i++) ...原创 2019-08-12 10:46:23 · 188 阅读 · 0 评论 -
Codeforces Round #512 (Div. 2) D. Vasya and Triangle
【题目链接】题意给你三个数字n m k,问你能否找到一个三角形面积为n * m / k,其中保证三角形三个点均为整数,并且横坐标x满足0 &lt; x &lt; n,纵坐标y满足0 &lt; y &lt; m,如果存在该三角形,输出YES,并输出三个点的坐标,否则,直接输出NO。examplesinput4 3 3outputYES1 02 34 1input4 4 7o...原创 2018-09-24 10:40:44 · 405 阅读 · 0 评论