http://codeforces.com/contest/1199/problem/D Examples input1 output1 input2 output2 Note In the first example the balances change as follows: 1 2 3 4 → 3 3 3 4 → 3 2 3 4 → 3 2 3 4 In the second example the balances change as follows: 3 50 2 1 10 → 3…
Div2 A 长度为\(n(n≤10^5)\)的数组,每个元素不同,求有多少个位置\(d\)满足\(d - x \le j < d \And d < j \le d + y a_d<a_j(0\le x,y\le 7)\) \(x,y\)较小,遍历每个位置,暴力判断即可 B 如下图,给出\(L,H\),求水面深度 设水面深度为\(x\),勾股定理:\(x^2+L^2=(x+H)^2\),解得\(x=\frac{L^2-H^2}{2H}\) Div1 A 长度为\(n(1 \le n \l…
C. MP3 time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One common way of digitalizing sound is to record sound intensity at particular time moments. For each time moment intensity is record…
A. Sereja and Dima time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains…
题目链接:Codeforces Round #298 (Div. 2) A. Exam An exam for n students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that students with adjacent numbers (i and i + 1) always studied side…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/output 1 s, 256 MB x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB x1462 C Vasya and String standard input/output 1 s, 256 MB x1393…