Codeforces Round #607 (Div. 1) Solution】的更多相关文章

从这里开始 比赛目录 我又不太会 div 1 A? 我菜爆了... Problem A Cut and Paste 暴力模拟一下. Code #include <bits/stdc++.h> using namespace std; typedef bool boolean; const int N = 1e6 + 5; const int Mod = 1e9 + 7; int T; int x; int len; char s[N]; int paste(int s1, int t1, in…
从这里开始 题目列表 小结 Problem A Points on the line Problem B Our Tanya is Crying Out Loud Problem C Phone Numbers Problem D Alena And The Heater Problem E Cashback Problem F Machine Learning 小结 这场比赛和同学一起打.本来应该是很开心的事情,结果留下好多遗憾. 第一个遗憾是没能在20分钟内消灭A.B题.然后分数就不是很可观…
对没错下面的代码全部是python 3(除了E的那个multiset) 题目链接:https://codeforces.com/contest/1157 A. Reachable Numbers 按位算贡献,一位数的贡献直接算即可 n=int(input()) ans=0 while (n>=10): tmp=n%10 tmp=10-tmp ans+=tmp n+=tmp while (n>0) and (n%10==0): n//=10 ans+=9 print(ans) B. Long N…
人生第一场Div. 1 结果因为想D想太久不晓得Floyd判环法.C不会拆点.E想了个奇奇怪怪的set+堆+一堆乱七八糟的标记的贼难写的做法滚粗了qwq靠手速上分qwqqq A. Skyscrapers 将行列各自离散化并记录下每一个值在行离散化时和列离散化时得到的值以及每一行.每一列出现的最大离散化值 对于每一行和每一列考虑其相交格子的两个离散化值,如果它们的差为\(\Delta\),就把它对应行列最大离散化值中较小的+\(\Delta\),最后两者取Max #include<iostream…
从这里开始 题目地址 瞎扯 Problem A Piles With Stones Problem B And Problem C Photo of The Sky Problem D Chemical table Problem E Hills Problem F AB-Strings 瞎扯 打比赛,发现自己越来越菜. 差点C题都不会了,怀疑人生... 发现自己C的贪心挂了两次然后D题不会怀疑不应来打这场比赛. 然后看到E.出题人的仁慈啊..终于不考智商了.提高组的送分dp(好吧,应该是省选里…
比赛传送门 这里推荐一位dalao的博客-- https://www.cnblogs.com/KisekiPurin2019/ A:字符串 B:贪心 A // https://codeforces.com/contest/1281/problem/A /* 暴力查找子序列 以最后的子序列为准 */ #include<iostream> #include<cstdio> #include<cstring> using namespace std; int T; char…
Problem A Hotelier 直接模拟即可~~ 复杂度是$O(10 \times n)$ # include<bits/stdc++.h> using namespace std; ; char s[N]; ]; int main() { int n; scanf("%d",&n); scanf("%s",s); ;i<n;i++) { if (s[i]=='L') { ;j<=;j++) if (!a[j]) { a[j]=…
A. Ehab and another construction problem Water. #include <bits/stdc++.h> using namespace std; int x; int main() { while (scanf("%d", &x) != EOF) { , b = -; ; i <= x && a == - && b == -; ++i) { for (int j = i; j <=…
A. A Prank Solved. 题意: 给出一串数字,每个数字的范围是$[1, 1000]$,并且这个序列是递增的,求最多擦除掉多少个数字,使得别人一看就知道缺的数字是什么. 思路: 显然,如果缺的这块数字的个数刚好等于右界 - 左界 + 1 那么就可以知道 还需要考虑数据范围,因为是$<= 1000  和 >= 1$ 那么对于两边的边界需要特殊考虑. #include <bits/stdc++.h> using namespace std; #define N 110 in…
A. Coins Water. #include <bits/stdc++.h> using namespace std; int n, s; int main() { while (scanf("%d%d", &n, &s) != EOF) { ; ; --i) while (s >= i) { ++res; s -= i; } printf("%d\n", res); } ; } B. Views Matter Solved.…