codeforces
文章平均质量分 85
codeforces比赛原题,以A题为主,锻炼我们的思维
冷颕
某小公司的java实习生
展开
-
B. Also Try Minecraft
题目意思很好理解,我们需要的是用个dp[k]表示从1到k(k>=1&&k原创 2022-07-23 13:44:38 · 263 阅读 · 0 评论 -
B. Making Towers
时间是1s,数据量很大,这题我的算法是吧它压缩到了(O(t*n))这么多时间,写这题需要一点一点动态规划的思想。首先解释一下一个色块距离下一个相同色块的距离必须为奇数,才能是色块加1。以为实在不好手绘,请自己在草稿纸上,按照题目要求画就行了。(可以参照第一个样例图)...原创 2022-07-19 11:10:52 · 296 阅读 · 0 评论 -
B. Difference of GCDs
0,那么我们就要想一想了,要么l>i要么l原创 2022-07-17 20:12:44 · 183 阅读 · 0 评论 -
C. Mark and His Unfinished Essay
首先这题时间不可能让我们按字符链接,所以我们需要另想办法比如说逆推,既然正向链接字符串无法解决,不妨逆推。我们知道length1[i+1]=length1[i]+(r[i]-l[i])+1;那么k=k-(lenght1[i+1]-r[i])-1就是向前面区间推进了。如果k在这个区间及是(length1[i],length1[i+1])逆推的过程,我们需要先确定k所在的长度区间,然后不停向前面区间推进。推进最初始的s字符串,让它输出。......原创 2022-07-16 21:34:55 · 477 阅读 · 3 评论 -
B. Almost Ternary Matrix
time limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard outputYou are given two even integers nn and mm. Your task is to find any binary matrix aa with nn rows and mm columns where every cell (i,j) has exactly two原创 2022-07-13 16:28:19 · 276 阅读 · 0 评论 -
B. All Distinct
(大家好,拖更了这么久,本博主又回来了)。B. All Distincttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSho has an array aa consisting of nn integers. An operation consists of choosing two distinct indices ii and jj and rem原创 2022-06-15 18:15:48 · 342 阅读 · 0 评论 -
A. Subtle Substring Subtraction
Alice and Bob are playing a game with strings. There will bettrounds in the game. In each round, there will be a stringssconsisting of lowercase English letters.Alice moves first and both the players take alternate turns.Alice is allowed to remove a...原创 2022-05-01 19:54:08 · 343 阅读 · 0 评论 -
A. Log Chopping
(注codeforces均为英文题,绝非博主闲的蛋疼搞成英文)There arennlogs, theii-th log has a length ofaimeters. Since chopping logs is tiring work, errorgorn and maomao90 have decided to play a game.errorgorn and maomao90 will take turns chopping the logs witherrorgorn ch...原创 2022-04-25 21:44:56 · 241 阅读 · 0 评论