QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#89862 | #94. Good Old Table | snpmrnhlol | RE | 0ms | 0kb | C++14 | 782b | 2023-03-21 17:28:04 | 2023-03-21 17:28:06 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
ifstream fin("cross.in");
ofstream fout("cross.out");
int v[3000][3000];
int v2[3000];
int v3[3000];
int main() {
int n,m,i,j,a = 0,ans = 0;
fin>>n>>m;
for(i = 0;i < n;i++){
for(j = 0;j < m;j++){
fin>>v[i][j];
if(v[i][j] == 2)v2[i]++;
if(v[i][j] == 2)v3[j]++;
}
}
if(n%2 == m%2){
for(i = 0;i < n;i++){
for(j = 0;j < m;j++){
//cin>>v[i][j];
a = 0;
if(v[i][j] == 2)a++;
a+=v2[i];a+=v3[j];
if(a%2 == 1)ans++;
//cout<<a%2<<' ';
}
//cout<<'\n';
}
fout<<ans;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Dangerous Syscalls
input:
3000 3000 2 1 2 1 2 1 1 1 1 2 1 1 2 2 1 2 2 2 2 1 1 1 2 1 1 2 2 2 2 2 2 1 1 1 1 2 1 2 1 2 1 2 2 2 2 1 1 2 2 1 1 1 1 2 1 2 1 2 1 2 1 1 1 2 1 1 2 1 2 2 1 1 1 2 2 2 2 1 1 2 2 2 2 2 2 2 1 2 1 1 1 2 2 1 1 1 1 1 2 2 2 2 1 2 2 1 2 1 1 2 2 2 1 1 1 2 1 1 2 1 2 2 2 1 2 2 1 1 2 1 2 2 1 1 1 1 2 1 2 2 1 1 2 2 2 ...