
div的相关题解
稳健的不二少年
代码简洁,思维严谨,每遇不会,必求甚解。
展开
-
Game with string-题解
题目:https://codeforces.com/problemset/problem/1104/BA 与 B 正在玩一个关于由小写拉丁字符构成的字符串 s 的游戏,每一个人会轮流操作,先 A 后 B,对于每一次操作,操作者需要将 s中的两个连续且相同的字符消除,消除后的字符串由另一个人操作,同样的,对于每一次操作,如果不能找到两个符合要求的字符,那么操作者输。例如以下情况:s = ‘‘x...原创 2019-07-08 17:30:54 · 252 阅读 · 0 评论 -
简单思维题CodeForces - 712B
传送门:https://codeforces.com/problemset/problem/712/B题意:L,R,U,D,分别向左边,向右边,向上边,向下走。你可以替换字符串,从而让他走到原点。问,给你字符串,最少需要替换几个。无解输出-1.很明显,字符串长度为奇数,怎么替换也不能走到原点,输出-1;字符串为偶数,要考虑什么呢?L,R是一对,U,D是一对。也就是说L,R个数要相对,U...原创 2019-08-05 23:46:40 · 94 阅读 · 0 评论 -
Codeforces Round #525 (Div. 2)B
传送门:https://codeforces.com/problemset/problem/1088/BB.Ehab and subtractionYou’re given an array原创 2019-07-26 22:28:35 · 103 阅读 · 0 评论 -
Codeforces Round#535(Div.3)A,B,C,D题解报告
传送门:https://codeforces.com/problemset/problem/1108/AA. Two distinct pointstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two s...原创 2019-07-26 21:06:40 · 206 阅读 · 0 评论 -
codeforces 1199A(Codeforces Round #576 (Div. 2))
Codeforces Round #576 (Div. 2)AA. City Daytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFor years, the Day of city N was held in the most ...原创 2019-08-04 16:44:07 · 174 阅读 · 0 评论 -
CodeForces - 978C,D,E,F
写在前面,这是我们的一场训练赛,也是我爆零的一场,很高兴,这场比赛让我认识到我的很多缺陷,也将成为我前进路上的动力!Codeforces Round #481 (Div. 3)CDEFLetters CodeForces - 978CThere are n dormitories in Berland State University, they are numbered with inte...原创 2019-08-02 21:11:33 · 586 阅读 · 0 评论 -
Educational Codeforces Round 69 (Rated for Div. 2)C
https://codeforces.com/contest/1197/problem/CYou are given a sorted array原创 2019-07-24 16:32:03 · 94 阅读 · 0 评论 -
Codeforces Round #568 (Div. 2 B - Email from Polycarp
B - Email from PolycarpMethodius received an email from his friend Polycarp. However, Polycarp’s keyboard is broken, so pressing a key on it once may cause the corresponding symbol to appear more tha...原创 2019-07-06 20:16:48 · 454 阅读 · 0 评论 -
Codeforces Round #561 (Div. 2)B All the Vowels Please
Tom loves vowels, and he likes long words with many vowels. His favorite words are vowelly words. We say a word of length原创 2019-07-06 16:28:42 · 187 阅读 · 0 评论 -
Codeforces Round #556 (Div. 2)B - Tiling Challenge
题意判断一幅图上是否有独立的完整类似十字架的点,如果没有,或者十字架上的点有覆盖都输出NO。首先把整幅图都设成#,遇到. 首先判断它的上下左右是否在这个图里面,其次如果在图里面,且符合条件,则把 . 全变成#(因为防止十字架上的点相互覆盖)。ps:遇到scanf("%d",&n);n后需要输入字符串的情况,要有getchar(),不然很容易wa掉.#define rep(i,a,b...原创 2019-07-06 11:19:42 · 197 阅读 · 0 评论 -
比较含有数字和字母的字符串
题目:https://codeforces.com/contest/1191/problem/B1.利用结构体strut T{int a;char c;}q[100];int cmp(T.x,T.y)return x.a<y.a;2.分别读入数字字母。int a1,a2,a3;char s1,s2,s3;scanf("%d%c%d%c%d%c")//适用于字符串长度短...原创 2019-07-13 09:24:15 · 614 阅读 · 0 评论 -
Codeforces Round #571 (Div. 2)-D. Vus the Cossack and Numbers
题意:选择一个n个长度的序列,序列的元素为double类型,每个double数可往上或者往下近似,但必须保证序列之和为0.先算出小数部分之和,根据小数部分的和来确定调整序列元素往上还是往下近似,从而达到相互平衡。#include#include#include#includeusing namespace std;const int maxn =1e5;int n;double ...原创 2019-07-03 11:08:11 · 297 阅读 · 0 评论 -
codeforces 976 E. Well played!
传送门:https://codeforces.com/contest/976/problem/E题意:Max拥有n个生物,其中第i个可以用两个数字来描述 - 它的健康hpi和它的伤害dmgi。 Max还有两种类型的法术:使生物的生命值翻倍(hpi:= hpi·2);将生物的健康值分配给其伤害(dmgi:= hpi)。第一种类型的法术总共可以使用不超过一次,第二种类型的法术总数不超过b次。法...原创 2019-07-28 21:19:50 · 168 阅读 · 0 评论