codefroces
文章平均质量分 60
%xiao Q
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #771 (Div. 2)
A. Reverse这题我们只需要把数组和按顺序排的数组(1,2,3…n)比较即可,找到第一个不相等的位置 l,然后继续在后面数组找到 l 位置原本应该放的最小的数字(即 l)的数的下标 r,然后翻转[l, r],如果都相等,那么这个就是最小的,直接输出参考代码:#include <iostream>#include <cstdio>#include <vector>#include <cstring>#include <cmath>原创 2022-02-15 20:36:48 · 632 阅读 · 0 评论 -
Codeforces Round #753 (Div. 3)
A. Linear Keyboard大水题,暴力就行参考代码:#include <iostream>#include <unordered_map>#include <cmath>using namespace std;const int N = 50;unordered_map<char, int> q;int main(){ string s1, s2; int T; cin >> T; while(T--)原创 2021-11-03 21:49:34 · 54 阅读 · 0 评论 -
Codeforces Round #750 (Div. 2)
A. Luntik and Concerts一道小学奥数题,就直接上代码了:#include <iostream>using namespace std;typedef long long LL;int main(){ int T; cin >> T; while(T--) { int a, b, c; cin >> a >> b >> c; LL sum = a + b * 2LL + c * 3LL原创 2021-10-25 21:10:38 · 70 阅读 · 0 评论 -
Codeforces Round #748 (Div. 3)
这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Mar原创 2021-10-15 19:34:54 · 51 阅读 · 0 评论 -
Codeforces Round #747 (Div. 2)
A. Consecutive Sum Riddle一道思维题思维题,一开始想歪了,后面发现巨简单,这就直接上代码了:#include<iostream>using namespace std;int main(){ int T; cin>>T; while(T--) { long long n; cin>>n; cout<<-(n-1)<<" "<<n<<endl; } }B. Spec原创 2021-10-10 11:20:24 · 69 阅读 · 0 评论 -
Codeforces Round #744 (Div. 3)
A. Casimir’s String Solitaire一道大水题,直接放代码了#include <iostream>using namespace std;int main(){ int T; cin >> T; while(T--) { string s; cin >> s; int t1 = 0, t2 = 0, t3 = 0; for(int i = 0; i < s.size(); i++) { i原创 2021-09-29 22:12:50 · 68 阅读 · 0 评论 -
cf--#730--div2
A. Exciting Betstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWelcome to Rockport City!It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a原创 2021-07-13 10:13:11 · 94 阅读 · 0 评论 -
cf--#729--div2
B. Plus and Multiplytime limit per test3 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputThere is an infinite set generated as follows:1 is in this set.If x is in this set, x⋅a and x+b both are in this set.For examp原创 2021-07-13 16:13:41 · 117 阅读 · 1 评论 -
codeforce round #735 div2 C. Mikasa
我们先来了解一下XOR 运算法则:a ^ a = 0a ^ b = b ^ a;(交换律)a ^ b ^ c = a ^ (b ^ c) = (a ^ b) ^ c;(结合律)c = a ^ b 可以推出 a = c ^ ba ^ b ^ a = ba ^ 0 = a本题主要是,找出n ^ 0, n ^ 1 … n ^ m中未出现的最小非负整数思路:如果存在y,n ^ x = y,( 0 <= x <= m)可以转化为 n ^ y = x,所以 n ^ y <= m.原创 2021-08-06 15:12:08 · 99 阅读 · 0 评论 -
codeforces global round 15 B. Running for Gold
B. Running for Goldtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Olympic Games have just started and Federico is eager to watch the marathon race.There will be n athletes, numbered from 1 to原创 2021-08-07 10:22:48 · 131 阅读 · 0 评论 -
cf--#729--div2
B. Pleasant Pairstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a1,a2,…,an consisting of n distinct integers. Count the number of pairs of indices (i,j) such that i<j and原创 2021-07-15 22:04:00 · 96 阅读 · 0 评论 -
Codeforces Global Round 16
A. Median Maximization这道题就是一简单的思维题,直接放代码#include <iostream>#include <cstdio>using namespace std;const int N = 1e4 + 10;int main(){ int T; cin >> T; while(T--) { int n, s; scanf("%d%d", &n, &s); if(n % 2 == 0原创 2021-09-13 15:20:54 · 117 阅读 · 6 评论 -
Educational Codeforces Round 114
A. Regular Bracket Sequences一道找规律的题,但还是给我整懵逼了,感觉比第二题还难,还是靠队友抬了一手才过的#include <iostream>using namespace std;int main(){ int T; cin >> T; while(T--) { int n; cin >> n; for(int i = 1; i <= n; i++) { int j = i, k =原创 2021-09-21 13:25:23 · 88 阅读 · 2 评论 -
Codeforces Round #743
A. Countdown这是一道简单的思维题,话也就不多说了,直接做#include <iostream>using namespace std;int main(){ int T; cin >> T; while(T--) { int n; string s; cin >> n >> s; int ans = 0; for(int i = 0; i < s.size() - 1; i++) {原创 2021-09-20 17:03:13 · 111 阅读 · 0 评论