![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
CF
文章平均质量分 58
chengor
这个作者很懒,什么都没留下…
展开
-
【CF】Codeforces Round #810 (Div. 2) c++代码
聚会中,如果有一对朋友,这一对朋友就要吃1个蛋糕,比如a有3个朋友到场了,他会吃3个蛋糕,如果a到场了但他没有朋友,他不吃蛋糕。所以,如果有m对朋友,m是偶数,就都可以来参加聚会。如果m是奇数,我们就要删除奇数对朋友的蛋糕,而‘不开心值’和朋友对数无关,只跟人有关,那么我们只可能删除1个人或2个人.,那么删掉他们相当于删掉cnt[a]+cnt[b]-1个人,如果他们都有偶数个朋友,那么删掉这2个人相当于删掉奇数个蛋糕,结果成立。如果2个人的朋友都有偶数个,删掉2人后,只删掉偶数个蛋糕,结果不成立。...原创 2022-07-25 09:50:01 · 111 阅读 · 0 评论 -
【CF】Educational Codeforces Round 132 (Rated for Div. 2) C++代码
Educational Codeforces Round 132 (Rated for Div. 2),abc题原创 2022-07-22 10:26:04 · 1337 阅读 · 0 评论 -
【CF】Educational Codeforces Round 131 (Rated for Div. 2)C++代码
Educational Codeforces Round 131 (Rated for Div. 2)原创 2022-07-15 20:50:35 · 479 阅读 · 0 评论 -
【CF补题】【D】Educational Codeforces Round 131 (Rated for Div. 2) C++代码
D. Permutation Restoration原创 2022-07-15 09:52:13 · 240 阅读 · 0 评论 -
【CF补题】Codeforces Round #806 (Div. 4)C++代码
A - YES or YES?B - ICPC BalloonsC - CypherD - Double Strings这题不用想太复杂,就直接模拟好了,我一开始开了2个vector然后tle了,应该是find有点耗时? E - Mirror Grid 这题有点搞,主要把正方形缩小1/4,看旋转的4个(奇数的话中间只有1个) 的“1”的数量,要么全变成1,要么全变成0.F - Yet Another Problem About Pair原创 2022-07-13 14:43:36 · 377 阅读 · 3 评论 -
【CF补题】Codeforces Round #790 (Div. 4)C++代码
懒得写题解,但欢迎提问。注意:Div. 4,Div. 4,Div. 4,暴力,暴力,暴力!能过,能过,能过!A.#include<bits/stdc++.h>using namespace std;int n;int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { int a = 0; int b = .原创 2022-07-13 14:31:56 · 183 阅读 · 0 评论 -
【CF补题】Codeforces Round #784 (Div. 4)C++代码
A.#include<bits/stdc++.h>using namespace std;int a, b;int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int k; cin >> k; while (k--) { int t; cin >> t; if (t <= 1399) cout << "Division 4\n"; e原创 2022-04-26 15:41:57 · 1095 阅读 · 0 评论 -
【CF补题】【ABC】Codeforces Round #782 (Div. 2) C++代码
#include<bits/stdc++.h>using namespace std;int n, r, b, p;int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { cin >> n >> r >> b; int k = b + 1; for (int i = 1; i &.原创 2022-04-18 22:37:22 · 705 阅读 · 0 评论 -
【CF补题】【ABC】Codeforces Round #777 (Div. 2) C++代码
A.Madoka and Math Dad【题意】求连续不带零且不相等位数的最大十进制数,使其位数之和为 n。有t个测试n【思考】根据样例我们就可以推测答案是121212...或212121....n%3=1时,答案是12..121n%3=2时,答案是21..212n%3=0时,答案是21..21#include<bits/stdc++.h>using namespace std;int main(){ ios::sync_with_stdio(false..原创 2022-04-16 21:34:13 · 2470 阅读 · 0 评论 -
【CF补题】【D】Educational Codeforces Round 125 (Rated for Div. 2) C++代码
D.For Gamers. By Gamers.现有 n种兵种,每种有单位招募代价、攻击力、生命值三个数值。需回答 m 次询问——每次询问给出魔王的攻击、生命,问在以下条件下,击败魔王至少需要花费多少代价?只能选择一种兵种的士兵招募 任意士兵不能在战斗中死亡 魔王与士兵并非回合制战斗,造成伤害是连续的。分析:因为士兵不能死亡,所以招募 k个士兵单纯等于将其攻击力变为 k 倍。所以...原创 2022-04-14 17:07:23 · 673 阅读 · 0 评论 -
【CF补题】【ABC】Educational Codeforces Round 125 (Rated for Div. 2) C++代码
A.Integer Moves【题目】只能横向或纵向移动,输出从点 (0,0) 移动到点 (x,y) 所需的最少操作次数。【解答】长度不限,所以答案只有3种可能,0、1、2。其中如果距离是整数则1,否则我们只要右移x,上移y就是2步。#include <bits/stdc++.h>using namespace std; typedef long long ll;const int maxn=200020;const int mo=1e9+7;int x,y;int.原创 2022-04-14 15:01:10 · 389 阅读 · 0 评论 -
【CF补题】【AB】Codeforces Round #779 (Div. 2) C++代码
A. Marin and Photoshoot【问题】对于每个片段,1 的数量都要大于0,【解答】所以两个0之间必须有2个以上的1。#include<bits/stdc++.h>using namespace std;int n;string s;//找到下一个0int Find(int now){ int nex = now + 1; while (s[nex] != '0'&& nex<n) { nex++; } return原创 2022-04-13 20:46:44 · 499 阅读 · 0 评论 -
【CF补题】【AB】Educational Codeforces Round 126 (Rated for Div. 2) C++代码
A. Array Balancing【题目简述】可交换a[n]、b[n]下标相同的元素,找的最小值【ps】写题的时候没有想到那么简单,写的递归可以直接一个for搞定,直接贪心,对每一个i-1到i,选择跨度少的那种情况#include<bits/stdc++.h>using namespace std; int n;int x[30],y[30];long long ans=1e9;void tryy(int a[],int b[],int k,long long ...原创 2022-04-13 15:11:41 · 687 阅读 · 0 评论