Submission #75704436


Source Code Expand

#include<bits/stdc++.h>
#define ll long long
#define rep(i,l,r) for(int i=(l);i<=(r);++i)
#define per(i,r,l) for(int i=(r);i>=(l);--i)

using namespace std;
int T,n,m;

void solve(){
    cin>>n>>m;ll s=0;
    rep(i,1,n)rep(j,1,n){ll x;cin>>x;if((i+j)&1)s^=(x%(m+1));}
    if(s)cout<<"Alice\n";else cout<<"Bob\n";
    return;
}

signed main(){
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>T;while(T--)solve();
    return 0;
}

Submission Info

Submission Time
Task D - Grid Game
User Fourier_WJY
Language C++23 (GCC 15.2.0)
Score 500
Code Size 459 Byte
Status AC
Exec Time 11 ms
Memory 3640 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 1
AC × 14
Set Name Test Cases
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3540 KiB
01_handmade_00.txt AC 11 ms 3616 KiB
01_handmade_01.txt AC 1 ms 3488 KiB
01_handmade_02.txt AC 1 ms 3432 KiB
01_handmade_03.txt AC 2 ms 3616 KiB
02_random_00.txt AC 11 ms 3488 KiB
02_random_01.txt AC 11 ms 3640 KiB
02_random_02.txt AC 11 ms 3500 KiB
02_random_03.txt AC 11 ms 3536 KiB
02_random_04.txt AC 11 ms 3392 KiB
02_random_05.txt AC 11 ms 3532 KiB
02_random_06.txt AC 11 ms 3500 KiB
02_random_07.txt AC 11 ms 3488 KiB
02_random_08.txt AC 11 ms 3540 KiB