随笔分类 - CF/AT
摘要:Dashboard - Codeforces Round 1066 (Div. 1 + Div. 2) - Codeforces Problem - A - Codeforces 题意: 平衡数组定义为:若 \(x\) 存在,则存在 \(x\) 个 \(x\),求给定数组至少删去多少数变成平衡数组。
阅读全文
摘要:Dashboard - Educational Codeforces Round 178 (Rated for Div. 2) - Codeforces Problem - A - Codeforces 数学 充要条件为 \(a+b+c\equiv 0\bmod 3\),且 \(c-b\ge b-a
阅读全文
摘要:Dashboard - Educational Codeforces Round 176 (Rated for Div. 2) - Codeforces A 贪心 数学 模拟 B 贪心 构造 C 组合数学 D 暴力 Problem - E - Codeforces ^e8e652 题意: 给定 \(
阅读全文
摘要:A. Strong Password 给定一个字符串,若 \(s_i \neq s_{i-1}\),则 \(s_i\) 的代价为2,否则为1。 向这个字符串中插入一个字符,使得代价最大。 在相邻相同的两个字符中间插入即可,没有相邻相同就在末尾插入,插入的字符与前后字符不同。 点击查看代码 #incl
阅读全文
摘要:A. Zhan's Blender 有 \(n\) 个水果,每秒可以消耗 \(\min\{x, y\}\) 个,问需要多少时间。 整数除法的上取整操作即可。 点击查看代码 #include<bits/stdc++.h> using namespace std; #define ll long lon
阅读全文
摘要:A - Jiro 输入 \(AB, BC, AC\) 的大小关系,输出中位数。 手动模拟一下。 点击查看代码 #include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long lon
阅读全文
摘要:A. Simple Palindrome 给定整数 \(n\),构造长度为 \(n\) 的只由a e i o u的字符串,使得它的回文子序列最少。 容易发现 aia 不如 aai 优,贪心的将每种字符放在一起,并将总个数尽量均分到每个字符上。 点击查看代码 #include<bits/stdc++.
阅读全文
摘要:A. Minimize! 输入 \(a,b\), 输出 \(b-a\)。 点击查看代码 #include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long int read(
阅读全文
摘要:A. Dora's Set 注意到任意两个偶数的 \(\gcd\) 都大于 \(1\) ,因此选择的三个数中至多一个偶数,而注意到相邻的奇数一定互质,因此每次选两个奇数一个偶数,答案=奇数的个数÷2 点击查看代码 #include<bits/stdc++.h> using namespace std
阅读全文
摘要:A. Sakurako's Exam 发现 \(1\) 比较万能,先让 \(2\) 相互抵消,再让 \(1\) 去抵消 \(2\) ,最后 \(1\) 相互抵消 点击查看代码 #include<bits/stdc++.h> using namespace std; #define ll long l
阅读全文
摘要:A. Primary Task if-else语句练习,判断前两个字符是否为"10",并判断之后的字符是否大于1 点击查看代码 #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigne
阅读全文
摘要:A. Closest Point 两个数时只要不相邻就有解,超过两个数无解 点击查看代码 #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define
阅读全文
摘要:良心出题人给了中文题解!!! A. Turtle and Good Strings 长度为 \(n\) 的字符串至少分成两段,使 \(\forall i < j\) ,第 \(i\) 段的首字符不等于第 \(j\) 段的尾字符 第一个字符一定作为首字符,最后一个字符一定作为尾字符,只要判断这两个字符
阅读全文
摘要:A. Make All Equal 签到题,先确定最终答案,然后把其他数删去,转化为统计众数 点击查看代码 #include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long
阅读全文

浙公网安备 33010602011771号