C. Predict Outcome of the Game 题目连接: http://codeforces.com/contest/451/problem/C Description There are n games in a football tournament. Three teams are participating in it. Currently k games had already been played. You are an avid football fan, but…
A. Game With Sticks (451A) 水题一道,事实上无论你选取哪一个交叉点,结果都是行数列数都减一,那如今就是谁先减到行.列有一个为0,那么谁就赢了.因为Akshat先选,因此假设行列中最小的一个为奇数,那么Akshat赢,否则Malvika赢. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace…
A - Game With Sticks 题目的意思: n个水平条,m个竖直条,组成网格,每次删除交点所在的行和列,两个人轮流删除,直到最后没有交点为止,最后不能再删除的人将输掉 解题思路: 每次删除交点所在的行和列,则剩下n-1行和m-1列,直到行或列被删完为止,最多删除的次数为min(n,m),删除min(n,m)后剩余的都是行或者列(注意行与行,列与列之间不可能有交点).只需要判断min(n,m)的奇偶性. #include <iostream> #include <vector&…
题目链接 A. Game With Sticks time limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard output After winning gold and silver in IOI 2014, Akshat and Malvika want to have some fun. Now they are playing a game on a g…
E. Devu and Flowers 题目连接: http://codeforces.com/contest/451/problem/E Description Devu wants to decorate his garden with flowers. He has purchased n boxes, where the i-th box contains fi flowers. All flowers in a single box are of the same color (hen…
D. Count Good Substrings 题目连接: http://codeforces.com/contest/451/problem/D Description We call a string good, if after merging all the consecutive equal characters, the resulting string is palindrome. For example, "aabba" is good, because after…