Codeforces Round #568 (Div. 2) 选做】的更多相关文章

A.B 略,相信大家都会做 ^_^ C. Exam in BerSU 题意 给你一个长度为 \(n\) 的序列 \(a_i\) .对于每个 \(i\in [1,N]\) 求 \([1,i-1]\) 中删去至少多少个数能满足剩余 \([1,i]\) 中数的和小于 \(M\) . \(n\le 2\cdot 10^5, M\le 2\cdot 10^7, a_i\le 100\) . Solution 看到值域 \(\le 100\) ,直接用桶记每个数出现多少次,然后从大到小暴力扫一遍桶就做完了.…
C. Neko does Maths 题意 给 \(a,b\) ,求一个最小的 \(k\) 使得 \(\text{lcm}(a+k,b+k)\) 最小. \(a,b\le 10^9\) 题解 \(\gcd (a+k,b+k) = \gcd(b-a,a+k)\) . 只需枚举 \(b-a\) 的因数作为 \(\gcd\) ,容易算出最小的 \(k\) ,然后更新答案即可. code #include<cstdio> long long mn=1ll<<60; int a,b,k; i…
这场和div3差不多嘛(后来发现就是div3),就是网太卡10min交一发就不错了,简直自闭. A 签到. B 记录每一段的字母数,满足条件即:段数相同+字母相同+字母数下>=上. #include<bits/stdc++.h> using namespace std; ; char a[N],b[N]; int n,m,n1,n2,c1[N],s1[N],c2[N],s2[N]; bool check() { ; n1=n2=; ;i<=n;i++)||a[i]!=a[i-])c…
B. Email from Polycarp 题目链接:http://codeforces.com/contest/1185/problem/B 题目: Methodius received an email from his friend Polycarp. However, Polycarp's keyboard is broken, so pressing a key on it once may cause the corresponding symbol to appear more…
A. Ropewalkers 题目链接:http://codeforces.com/contest/1185/problem/A 题目: Polycarp decided to relax on his weekend and visited to the performance of famous ropewalkers: Agafon, Boniface and Konrad. The rope is straight and infinite in both directions. At…
有点菜,只写出了三道.活不多说,上题开干. A. Ropewalkers Polycarp decided to relax on his weekend and visited to the performance of famous ropewalkers: Agafon, Boniface and Konrad. The rope is straight and infinite in both directions. At the beginning of the performance…
没有找到这场div3被改成div2的理由. A:签到. #include<bits/stdc++.h> using namespace std; #define ll long long #define inf 1000000010 char getc(){char c=getchar();while ((c<'A'||c>'Z')&&(c<'a'||c>'z')&&(c<'0'||c>'9')) c=getchar();re…
链接: https://codeforces.com/contest/1185/problem/D 题意: A sequence a1,a2,-,ak is called an arithmetic progression if for each i from 1 to k elements satisfy the condition ai=a1+c⋅(i−1) for some fixed c. For example, these five sequences are arithmetic…
链接: https://codeforces.com/contest/1185/problem/C2 题意: The only difference between easy and hard versions is constraints. If you write a solution in Python, then prefer to send it in PyPy to speed up execution time. A session has begun at Beland Stat…
链接: https://codeforces.com/contest/1185/problem/B 题意: Methodius received an email from his friend Polycarp. However, Polycarp's keyboard is broken, so pressing a key on it once may cause the corresponding symbol to appear more than once (if you press…