QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#532985#8474. Matrices and SumsLavine#AC ✓30ms7696kbC++14652b2024-08-25 15:28:142024-08-25 15:28:15

Judging History

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

  • [2024-08-25 15:28:15]
  • 评测
  • 测评结果:AC
  • 用时:30ms
  • 内存:7696kb
  • [2024-08-25 15:28:14]
  • 提交

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("");
        }
    }
}

Details

Tip: Click on the bar to expand more detailed information

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.