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]=…
Codeforces Round #578 (Div. 2) 传送门 A. Hotelier 暴力即可. Code #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e5 + 5; int n; char s[N]; int res[10]; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> n;…
从这里开始 题目列表 小结 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…
从这里开始 题目地址 瞎扯 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(好吧,应该是省选里…
从这里开始 比赛目录 我又不太会 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…
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. 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.…