合集-ABC
摘要:A link 其实,有人赢比赛,就有人输比赛,一加一减,不管进行多少场比赛,最后所有人的分数和一定是 。 那么知道 个人的分数和,就可以知道第 个人的了。 点击查看代码 #include<bits/stdc++.h> using namespace std; int n;
阅读全文
摘要:A link 这道题就先输出整个的 ,再输出剩一个两个的。 点击查看代码 #include<bits/stdc++.h> using namespace std; int n; signed main(){ cin >> n; int t = n/3; for(int i = 1;i <
阅读全文
摘要:A link 很简单 遍历,判断模 是否为 ,如果为 ,输出 。 点击查看代码 #include<bits/stdc++.h> using namespace std; int n,k; int a[105]; signed main(){ cin >> n
阅读全文
摘要:C link 我们可以把所有字母都存上,代表换到最后这个字母换成什么了,当然最开始就是它本身。 那么,把 改成 的时候,就只要把所有等于 的都改成 就行了。 点击查看代码 #include<bits/stdc++.h> using namespace std; int
阅读全文
摘要:E link 这个题目中所说的好的其实就是像 这样一个 ,一个 的字符串。 那么不好的就是两个 或两个 在一起,所以判断一个区间好不好只需要判断一个区间内有没有两个 或两个 在一起,那么我们可以把两个 或两个 在一起的
阅读全文
摘要: link 首先,考虑暴力,用一个堆,存所有数,每次拿出最大的数,拆开加入堆,计入答案,直到最大的 ,时间复杂度 。 考虑想求出 ,要什么。 求 一定是第一次把 拆成\(\lfloor{\frac{n}{2
阅读全文
摘要:A link 把最后三位取成数字,判断是否小于 ,大于 ,不等于 。 点击查看代码 #include<bits/stdc++.h> using namespace std; char s[10]; int ans; signed main(){ cin >> s+1;
阅读全文
摘要:A link 算出两个队分别得了几分,让木青队的总得分比高桥队多 即可。 点击查看代码 #include<bits/stdc++.h> using namespace std; int gq,mq; signed main(){ int x; for(int i = 1;i <= 9;++
阅读全文
摘要:A link 停不到, 能停到。 要先判断是从前往后还是从后往前。 点击查看代码 #include<bits/stdc++.h> using namespace std; signed main(){ int n,x,y,z; cin >> n >> x >> y >> z; if
阅读全文
摘要:A link 暴力寻找 及以后比 大的数。 点击查看代码 #include<bits/stdc++.h> using namespace std; int n; int a[105]; signed main(){ cin >> n; for(int i = 1;i <= n;+
阅读全文
摘要:A link 模拟整个过程即可。 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; signed main(){ int h; cin >> h; int day = 1ll,g = 0ll; whil
阅读全文
摘要:A link 把 ~ 和 ~ 部分顺序输出 ~ 部分逆序输出。 点击查看代码 #include<bits/stdc++.h> using namespace std; int n,l,r; signed main(){ cin
阅读全文
摘要:A link 循环加每一个数,加到哪个数不能加了输出前一个数,注意如果加到最后还能加,记得输出 。 点击查看代码 #include<bits/stdc++.h> using namespace std; int n,m; int h[105],sum; signed main(){ cin
阅读全文
摘要:A link …… 点击查看代码 #include<bits/stdc++.h> using namespace std; string s,t; signed main(){ cin >> s >> t; if(s == "AtCoder"&&t == "Land") cout << "Yes";
阅读全文
摘要:A link 先输出前 个,再输出 ,最后输出后面的。 点击查看代码 #include<bits/stdc++.h> using namespace std; int n,k,x; signed main(){ cin >> n >> k >> x; for(int i = 1;i
阅读全文
摘要:A link 判断即可。。。 点击查看代码 #include<bits/stdc++.h> using namespace std; int r,g,b; string c; signed main(){ cin >> r >> g >> b >> c; if(c == "Red") cout <<
阅读全文
摘要:A link 判断即可。 点击查看代码 #include<bits/stdc++.h> using namespace std; int r; signed main(){ cin >> r; if(r < 100) cout << 100-r; else if(r < 200) cout << 2
阅读全文
摘要:A link 循环判断,除了最后两个点以外,有连续 个甜的就不能吃完。 点击查看代码 #include<bits/stdc++.h> using namespace std; int n; string s[105]; signed main(){ cin >> n; for(int i =
阅读全文
摘要:A link 题目已经说的很明白了,判断即可。 点击查看代码 #include<bits/stdc++.h> using namespace std; int y; signed main(){ cin >> y; if(y%4 != 0) cout << 365; else if(y%4 == 0
阅读全文
摘要:A link 判断一下少的那个人加上剩下的所有票是否会超过另一个人,如果超过,不确定,否则目前票多的必胜。 神奇的代码 #include<bits/stdc++.h> using namespace std; signed main(){ int n,a,b; cin >> n >> a >> b;
阅读全文