![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
文章平均质量分 57
独一无二的VV
冲就完事了
展开
-
Educational Codeforces Round 113 (Rated for Div. 2)--C. Jury Meeting
代码思路这是一道排列组合题,稍微推一下公式就能求出,主要是要用到逆元,组合数等方法求解#include <bits/stdc++.h>using namespace std;#define ll long long#define mod 998244353ll jc[200005], in[200005];ll ksm(ll a, ll b) { ll ans = 1; while (b) { if (b & 1)原创 2021-09-09 20:08:15 · 126 阅读 · 0 评论 -
Educational Codeforces Round 113 (Rated for Div. 2)--B. Chess Tournament
思路只需求出主对角线上半部分,或者下半部分的情况就行,因为另一部分肯定与对称的部分相反用一个二维数组b记录一下情况,和一个一维数组vis表示第i个人是否有赢过判断b[i][j]的值分情况讨论,若a[i]==1或者a[j]==1,则b[i][j]为平局;若a[i]=2且i未胜过一局,则b[i][j]为i胜,若a[j]=2且j未胜过一局,则b[i][j]为i败最后判断一下是否所有为2的人都赢过至少一局,假如否则输出NO,是则输出YES代码#include <bits/stdc++.h&g.原创 2021-09-09 00:40:48 · 190 阅读 · 0 评论 -
Codeforces Round #729 (Div. 2)--C. Strange Function
Codeforces Round #729 (Div. 2)–C. Strange Function思路满足f(n)=i,即1,2,3…i-1都是n的倍数,即n为1,2,3…i-1的最小公倍数的整数倍思路是i从1开始枚举,求满足f(k)=i等式的k的个数的和(k<=n)当1,2,3…,i的最小公倍数大于n的时候,循环结束,因为n不可能是往后的1,2,3…i+1的最小公倍数的整数倍了如何求k的个数呢,当k为lcm(1,2,3…,i-1)的最小公倍数的倍数且k不为lcm(1,2,3…,i)的原创 2021-09-07 18:05:51 · 130 阅读 · 0 评论 -
Codeforces Round #742 (Div. 2)–C. Carrying Conundrum
Codeforces Round #742 (Div. 2)–C. Carrying Conundrum思路将n每隔一位拆成两个数,例如n=12345的时候,拆成两个数a和b,a=135,b=24,问题转化为求和等于135乘以和等于24的值,举个例子45+90=135,9+15=24,再每隔一位合在一起变为495+1905=12345#include <bits/stdc++.h>#define ll long longusing namespace std;int main(原创 2021-09-06 19:57:29 · 95 阅读 · 1 评论 -
Codeforces Round #742 (Div. 2)--B. MEXor Mixup
Codeforces Round #742 (Div. 2)–B. MEXor Mixup思路首先知道确定一个异或的数a和异或后的值x满足a^b=x,那么有且只有一个b满足该等式数组的最小长度肯定是大于等于a的,所以先让ans=a首先初始化将1到n的异或的值全都筛选出来保存到一个数组中如果异或的值等于b的话,那么答案就是a,否则,将得到的值与数组中没有出现的最小值(也就是a)异或,假如得到的值等于k,那么ans=n+2,否则ans=n+1#include <bits/原创 2021-09-06 00:15:52 · 230 阅读 · 0 评论 -
Deltix Round, Summer 2021 (open for everyone, rated, Div. 1 + Div. 2)--C. Compressed Bracket Sequenc
AC代码#include <bits/stdc++.h>#define ll long longusing namespace std;const int N = 10005;ll a[N];int main() { int n; cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; ll ans = 0; for (int i = 1; i &l.原创 2021-09-01 14:04:28 · 344 阅读 · 0 评论 -
Deltix Round, Summer 2021 (open for everyone, rated, Div. 1 + Div. 2)--B. Take Your Places!
Deltix Round, Summer 2021 (open for everyone, rated, Div. 1 + Div. 2)–B. Take Your Places!William has an array of nn integers a1,a2,…,ana1,a2,…,an. In one move he can swap two neighboring items. Two items aiai and ajaj are considered neighboring if the co原创 2021-08-30 12:27:18 · 398 阅读 · 0 评论 -
Codeforces Round #741 (Div. 2)--C. Rings
Codeforces Round #741 (Div. 2)–C. RingsSomewhere in a parallel Middle-earth, when Saruman caught Frodo, he only found nn rings. And the ii-th ring was either gold or silver. For convenience Saruman wrote down a binary string ss of nn characters, where the原创 2021-08-27 12:23:26 · 148 阅读 · 0 评论 -
Codeforces Round #740 (Div. 2, based on VK Cup 2021 - Final (Engine))--C. Deep Down Below
Codeforces Round #740 (Div. 2, based on VK Cup 2021 - Final (Engine))–C. Deep Down BelowIn a certain video game, the player controls a hero characterized by a single integer value: power. The hero will have to beat monsters that are also characterized by原创 2021-08-26 12:43:24 · 106 阅读 · 1 评论 -
Codeforces Round #737 (Div. 2)---C. Moamen and XOR
Codeforces Round #737 (Div. 2)—C. Moamen and XORMoamen and Ezzat are playing a game. They create an array aa of nn non-negative integers where every element is less than 2^k.Moamen wins if a1&a2&a3&…&an≥a1⊕a2⊕a3⊕…⊕ana1&a2&a3&…原创 2021-08-26 12:22:42 · 151 阅读 · 1 评论