随笔分类 - CF/AT
摘要:A. Strong Password 给定一个字符串,若 ,则 的代价为2,否则为1。 向这个字符串中插入一个字符,使得代价最大。 在相邻相同的两个字符中间插入即可,没有相邻相同就在末尾插入,插入的字符与前后字符不同。 点击查看代码 #incl
阅读全文
摘要:A. Zhan's Blender 有 个水果,每秒可以消耗 个,问需要多少时间。 整数除法的上取整操作即可。 点击查看代码 #include<bits/stdc++.h> using namespace std; #define ll long lon
阅读全文
摘要:A - Jiro 输入 的大小关系,输出中位数。 手动模拟一下。 点击查看代码 #include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long lon
阅读全文
摘要:A. Simple Palindrome 给定整数 ,构造长度为 的只由a e i o u的字符串,使得它的回文子序列最少。 容易发现 aia 不如 aai 优,贪心的将每种字符放在一起,并将总个数尽量均分到每个字符上。 点击查看代码 #include<bits/stdc++.
阅读全文
摘要:A. Minimize! 输入 , 输出 。 点击查看代码 #include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long int read(
阅读全文
摘要:A. Dora's Set 注意到任意两个偶数的 都大于 ,因此选择的三个数中至多一个偶数,而注意到相邻的奇数一定互质,因此每次选两个奇数一个偶数,答案=奇数的个数÷2 点击查看代码 #include<bits/stdc++.h> using namespace std
阅读全文
摘要:A. Sakurako's Exam 发现 比较万能,先让 相互抵消,再让 去抵消 ,最后 相互抵消 点击查看代码 #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 长度为 的字符串至少分成两段,使 ,第 段的首字符不等于第 段的尾字符 第一个字符一定作为首字符,最后一个字符一定作为尾字符,只要判断这两个字符
阅读全文
摘要:A. Make All Equal 签到题,先确定最终答案,然后把其他数删去,转化为统计众数 点击查看代码 #include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long
阅读全文