2021.07.16【NOIP提高B组】模拟 下棋
作者:互联网
思路:
首先每一步操作都会点到(1, 1)这个点,所以只要一直把(1,1)这个点翻白就行
要注意有多组游戏,所以最后答案要异或
c o d e code code
#include<iostream>
#include<cstdio>
using namespace std;
int t;
int k, n, m;
int ma[1000][1000];
int main()
{
scanf("%d", &t);
while(t--)
{
scanf("%d", &k);
int ans=0;
for(int i=1; i<=k; i++)
{
scanf("%d%d", &n, &m);
for(int j=1; j<=n; j++)
for(int l=1; l<=m; l++)
scanf("%d", &ma[j][l]);
ans^=ma[1][1];
}
if(ans==0)
printf("ld win\n");
else
printf("lyp win\n");
}
return 0;
}
Server time: Sun Jul 18 2021 08:45:30 GMT+0800 (中国标准时间)
标签:code,2021.07,NOIP,16,int,scanf,翻白,include,1000 来源: https://blog.csdn.net/liuziha/article/details/118873028