time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of b consecu…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Just to remind, girls in Arpa's land are really nice. Mehrdad wants to invite some Hoses to the palace for a dancing party. Each Hos has some wei…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a str…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Mr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal to n (n ≥ 2) burles and th…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Local authorities have heard a lot about combinatorial abilities of Ostap Bender so they decided to ask his help in the question of urbanization…
Codeforces Round 1137 这场比赛做了\(A\).\(B\),排名\(376\). 主要是\(A\)题做的时间又长又交了两次\(wa4\)的. 这两次错误的提交是因为我第一开始想的求最大值很不对,竟然还有\(min\)在里面... Codeforces 1137 A 题意:给一个矩阵,问对于每一个格子\((x,y)\),把第\(x\)行和第\(y\)列的值取出,要求将它们每一个赋上一个正整数,要求同一行.列中大小关系依然相同,问最大的数. 思路:我们先考虑每一行(列)的数们把它…
Codeforces Round 1132 这场比赛做了\(A\).\(B\).\(C\).\(F\)四题,排名\(89\). \(A\)题\(wa\)了一次,少考虑了一种情况 \(D\)题最后做出来,但被\(hack\)了...被\(hack\)的原因是没有想到答案会超过\(10^{12}\)(毕竟这个时间上的优化也是在最后迫不得已的情况下加的,就没有考虑正确性... Codeforces 1132 C 题意:给一些区间\([l_i,r_i]\),从中删掉两个,求剩下的区间最多能够覆盖的格子数…
Codeforces Round 1120 这场比赛做了\(A\).\(C\)两题,排名\(73\). \(A\)题其实过的有点莫名其妙...就是我感觉好像能找到一个反例(现在发现我的算法是对的... \(C\)题的心路历程: 第一眼:这不后缀自动机吗??? 算了滚去写哈希表乱搞吧... 嗯怎么\(mle\)了???算了把数组改成\(vector\)吧... 嗯怎么又\(wa\)了???算了我还是老老实实去敲SAM吧... 嗯???\(pretest\ passed\)??!! 所以就交了\(3…
Codeforces Round 1129 这场模拟比赛做了\(A1\).\(A2\).\(B\).\(C\),\(Div.1\)排名40. \(A\)题是道贪心,可以考虑每一个站点是分开来的,把目的地最小编号的留到最后,所以答案稍微算一下就行了. \(B\)题是道找规律,首先可以很容易地发现只要前面弄个负数的开头,错误算法就会忽略掉这一个值,所以利用这个来构造答案.(最讨厌构造题了)然后推导一番式子就会发现如果我们将第一个值放-1,则 \(\sum_{i=2}^na_i=k+n\), 再更改一…