QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#532985 | #8474. Matrices and Sums | Lavine# | AC ✓ | 30ms | 7696kb | C++14 | 652b | 2024-08-25 15:28:14 | 2024-08-25 15:28:15 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1e6+5,M=1e9+7;
int n,a[1004][1004],v[15];
int main(){
scanf("%d",&n);
if(n%2==1){
puts("No");
}else {
puts("Yes");
int k=n/2;
for(int i=1;i<=k;++i){
for(int j=1;j<=k;++j){
a[i][j]=-1;
a[i+k][j+k]=1;
if(i+j>=k+1){
a[i+k][j]=1;
}else a[i][j+k]=-1;
}
}
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
printf("%d ",a[i][j]);
}
puts("");
}
}
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3960kb
input:
2
output:
Yes -1 0 1 1
result:
ok OK, Accepted.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
1
output:
No
result:
ok OK, Accepted.
Test #3:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
3
output:
No
result:
ok OK, Accepted.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3968kb
input:
4
output:
Yes -1 -1 -1 0 -1 -1 0 0 0 1 1 1 1 1 1 1
result:
ok OK, Accepted.
Test #5:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
5
output:
No
result:
ok OK, Accepted.
Test #6:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
6
output:
Yes -1 -1 -1 -1 -1 0 -1 -1 -1 -1 0 0 -1 -1 -1 0 0 0 0 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1
result:
ok OK, Accepted.
Test #7:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
7
output:
No
result:
ok OK, Accepted.
Test #8:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
8
output:
Yes -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 0 0 -1 -1 -1 -1 -1 0 0 0 -1 -1 -1 -1 0 0 0 0 0 0 0 1 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
result:
ok OK, Accepted.
Test #9:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
9
output:
No
result:
ok OK, Accepted.
Test #10:
score: 0
Accepted
time: 0ms
memory: 3960kb
input:
10
output:
Yes -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 0 0 -1 -1 -1 -1 -1 -1 -1 0 0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
result:
ok OK, Accepted.
Test #11:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
21
output:
No
result:
ok OK, Accepted.
Test #12:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
37
output:
No
result:
ok OK, Accepted.
Test #13:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
73
output:
No
result:
ok OK, Accepted.
Test #14:
score: 0
Accepted
time: 1ms
memory: 4288kb
input:
100
output:
Yes -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...
result:
ok OK, Accepted.
Test #15:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
233
output:
No
result:
ok OK, Accepted.
Test #16:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
555
output:
No
result:
ok OK, Accepted.
Test #17:
score: 0
Accepted
time: 19ms
memory: 7336kb
input:
666
output:
Yes -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...
result:
ok OK, Accepted.
Test #18:
score: 0
Accepted
time: 28ms
memory: 7656kb
input:
888
output:
Yes -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...
result:
ok OK, Accepted.
Test #19:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
999
output:
No
result:
ok OK, Accepted.
Test #20:
score: 0
Accepted
time: 30ms
memory: 7696kb
input:
1000
output:
Yes -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...
result:
ok OK, Accepted.