QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#89862#94. Good Old TablesnpmrnhlolRE 0ms0kbC++14782b2023-03-21 17:28:042023-03-21 17:28:06

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-21 17:28:06]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2023-03-21 17:28:04]
  • 提交

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;
}

详细

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 ...

output:


result: