QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#668423 | #5544. Grid Game | temmie | WA | 1ms | 3764kb | C++17 | 1003b | 2024-10-23 14:20:58 | 2024-10-23 14:21:03 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
#define ALL(x) x.begin(), x.end()
#define SZ(x) ((int)x.size())
#define fastio ios::sync_with_stdio(0), cin.tie(0);
using namespace std;
#ifdef LOCAL
#define cout cout << "\033[0;32m"
#define cerr cerr << "\033[0;31m"
#define endl "\n" << "\033[0m"
#else
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,sse3,sse4,popcnt")
#define endl "\n"
#endif
const int MAX_N = 5e5+10;
const int INF = 2e18;
int n, m;
vector<vector<int>> arr;
void solve1(){
// input
cin >> n >> m;
arr.assign(n+1, vector<int>(m+1, -1));
for (int i=0 ; i<n ; i++){
for (int j=0 ; j<m ; j++){
cin >> arr[i][j];
}
}
int nim = 0;
for (int i=0 ; i<n ; i++){
for (int j=0 ; j<m ; j++){
if (arr[i+1][j]==-1 && arr[i][j+1]==-1){
nim ^= arr[i][j];
}
}
}
// output
cout << (nim ? "first" : "second") << endl;
return;
}
signed main(){
fastio;
int t = 1;
while (t--){
solve1();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3764kb
input:
5 6 0 0 0 0 0 0 0 3 3 0 0 0 0 0 3 -1 0 0 0 0 3 3 3 3 0 0 -1 -1 -1 -1
output:
first
result:
ok single line: 'first'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
2 2 1 1 2 -1
output:
first
result:
ok single line: 'first'
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3572kb
input:
1 1 -1
output:
first
result:
wrong answer 1st lines differ - expected: 'second', found: 'first'