QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#181612 | #3767. 奇矩阵 | 01team# | AC ✓ | 7ms | 12264kb | C++14 | 915b | 2023-09-16 21:20:19 | 2023-09-16 21:20:19 |
Judging History
answer
#include<bits/stdc++.h>
#define LL long long
#define SZ(x) ((LL)(x.size()))
using namespace std;
long long read(){
long long q=0,w=1;
char ch=getchar();
while(ch>'9' || ch<'0'){if(ch=='-')w=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){q=q*10+(ch-'0');ch=getchar();}
return q*w;
}
void write(LL x){
if(x<0){putchar('-');x=(-x);}
if(x>9)write(x/10);
putchar('0'+x%10);
}
void writeln(LL x){write(x);puts("");}
void writecs(LL x){write(x);putchar(' ');}
const long long N = 1000+95;
long long n,m,a[N][N],b[N];
inline LL myabs(LL x){return ((x<0)?(-x):(x));}
int main(){
while(scanf("%lld%lld",&n,&m)!=EOF){
for(LL i=1;i<=n;i++){
b[i]=0;
for(LL j=1;j<=m;j++){a[i][j]=read();b[i]+=a[i][j];}
}
bool fl=true;
for(LL i=1;i<=n&&fl;i++)
for(LL j=i+1;j<=n;j++)
if(!(myabs(b[i]-b[j])&1)){fl=false;break;}
if(fl)puts("Yes");
else puts("No");
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 7ms
memory: 12264kb
input:
1 2 0 0 2 3 1 2 3 2 1 4 3 3 1 2 3 4 5 6 7 8 9 1 1000 8 9 1 7 4 2 0 5 3 7 8 3 4 7 2 3 0 1 7 5 2 8 0 4 9 2 0 9 6 8 3 5 2 6 0 2 6 0 9 3 4 8 5 4 2 2 4 4 6 7 8 1 1 8 0 7 2 0 3 2 6 1 9 1 5 0 0 5 6 7 3 6 1 0 8 2 5 7 0 7 3 8 6 3 1 5 2 1 8 4 1 0 1 2 3 3 6 3 5 6 7 0 7 7 3 2 0 9 9 1 6 0 1 6 3 7 6 3 6 7 4 3 7 7...
output:
Yes Yes No Yes No No Yes No Yes Yes No Yes No Yes Yes Yes Yes No No No Yes Yes Yes No No No Yes Yes Yes Yes Yes Yes No No No Yes Yes No Yes Yes Yes Yes No Yes Yes No Yes Yes Yes No No Yes No No Yes Yes Yes Yes No No Yes No No No No No Yes Yes No Yes No No Yes Yes Yes Yes No Yes No Yes Yes No Yes No ...
result:
ok 257 lines