题意: There is a polyline going through points (0, 0) – (x, x) – (2x, 0) – (3x, x) – (4x, 0) – ... - (2kx, 0) – (2kx + x, x) – .... We know that the polyline passes through the point (a, b). Find minimum positive value x such that it is true or determi…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output There is a polyline going through points (0, 0) – (x, x) – (2x, 0) – (3x, x) – (4x, 0) – - - (2kx, 0) – (2kx + x, x) – -. We know that the polyli…
题目链接:http://codeforces.com/problemset/problem/1096/D 题意: 有一长度为n的字符串,每一字符都有一个权值,要求现在从中取出若干个字符,使得字符串中没有子串hard,(这里的子串在原串中不需要连续).求取出字符的最小权值和. Vasya is preparing a contest, and now he has written a statement for an easy problem. The statement is a string…
E. Colored Balls time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n boxes with colored balls on the table. Colors are numbered from 1 to n. i-th box contains ai balls, all of which…