题目链接:https://codeforces.com/contest/1296/problem/C C. Yet Another Walking Robot time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There is a robot on a coordinate plane. Initially, the robot
There are nn monsters standing in a row numbered from 11 to nn . The ii -th monster has hihi health points (hp). You have your attack power equal to aa hp and your opponent has his attack power equal to bb hp. You and your opponent are fighting these
C 对每一步结束之后往map里存个位置,看停留在相同位置的最少差多少步就行了. D 由\(h\%(a+b)\leq (x+1)a\)得\(x_{min}=\lceil\frac{h\%(a+b)}{a}\rceil-1\).然后贪心即可. E1 注意到要把原字符串排序,每一对逆序对都要进行一次交换,即每一对逆序对的颜色都必须不同.因此所需的颜色数即为最长的逆序链长. 对E1,可以考虑建图,每个位置看成一个点,把每一对逆序对建边,很显然这就是判断是不是一张二分图. E2 对E2,依次考虑字母a,b
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 D T