Content 圣诞老人坐在一个桌子被摆成 \(m\) 行 \(n\) 列的教室里.每个桌子有两个座位,每个位置从左往右都有编号,依次为 \(1,2,3,...,2\times n\times m\).已知圣诞老人坐在编号为 \(k\) 的位置,求: 圣诞老人坐在第几列第几行. 圣诞老人的座位是在桌子的左边还是右边. 数据范围:\(1\leqslant n,m\leqslant 10000,1\leqslant k\leqslant 2\times 10^8\)(\(2\times n\time…
E. Santa Claus and Tangerines time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Santa Claus has n tangerines, and the i-th of them consists of exactly ai slices. Santa Claus came to a school…
D. Santa Claus and a Palindrome time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Santa Claus likes palindromes very much. There was his birthday recently. k of his friends came to him to co…
E. Santa Claus and Tangerines time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Santa Claus has n tangerines, and the i-th of them consists of exactly ai slices. Santa Claus came to a school…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Santa Claus has n tangerines, and the i-th of them consists of exactly ai slices. Santa Claus came to a school which has k pupils. Santa dec…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Santa Claus likes palindromes very much. There was his birthday recently. k of his friends came to him to congratulate him, and each of them…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Santa Claus has Robot which lives on the infinite grid and can move along its lines. He can also, having a sequence of m pointsp1, p2, ..., …
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Santa Claus decided to disassemble his keyboard to clean it. After he returned all the keys back, he suddenly realized that some pairs of ke…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom t…
Santa Claus and a Palindrome 题目链接:http://codeforces.com/contest/752/problem/D 贪心 很自然地,可以想到,若subS不是回文串,那么只要贪心取subS中的最大值和reverse_subS中的最大值,若他们和大于零,则加入到结果回文序列中:而当subS本身就为回文串时,需要分类讨论(可以放在结果回文序列的最中间): 为了方便理解,定义: 若subS中的最大值与次大值的和小于零(或subS中只有一个值),那么称该最大值(或该…