题解:P8887 [DMOI-R1] 柯基棋

· · 题解

P8887 [DMOI-R1] 柯基棋

解题思路:

分类讨论题!

由于小 C 每次只会让棋盘边长增加 2,所以不会影响棋盘奇偶性,不用管。

CODE:

#include <iostream>
using namespace std;
int t, n, q, s;
int main()
{
    cin >> t;
    while (t--)
    {
        cin >> n >> q >> s;
        if (n & 1) cout << "A won\n";
        else cout << "B won\n";
    }
    return 0;
}