QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#880450#8474. Matrices and Sumscocoa_chan#AC ✓39ms12512kbC++14553b2025-02-03 13:12:182025-02-03 13:12:20

Judging History

This is the latest submission verdict.

  • [2025-02-03 13:12:20]
  • Judged
  • Verdict: AC
  • Time: 39ms
  • Memory: 12512kb
  • [2025-02-03 13:12:18]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll n,m,i,j,k,l,r,x,y,z,w,s,t,a[1100][1100];
int main()
{
    scanf("%lld",&n);
    if(n%2==1)
    {
        printf("No");
        return 0;
    }
    printf("Yes\n");
    for(i=1;i<=n/2;i++)
    {
        for(j=i;j<=n;j++)
        {
            a[i][n+1-j]=1;
        }
        for(j=i+1;j<=n;j++)
            a[n+1-i][j]=-1;
    }
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n;j++)
            printf("%lld ",a[i][j]);
        printf("\n");
    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3840kb

input:

2

output:

Yes
1 1 
0 -1 

result:

ok OK, Accepted.

Test #2:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

1

output:

No

result:

ok OK, Accepted.

Test #3:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

3

output:

No

result:

ok OK, Accepted.

Test #4:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

4

output:

Yes
1 1 1 1 
1 1 1 0 
0 0 -1 -1 
0 -1 -1 -1 

result:

ok OK, Accepted.

Test #5:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

5

output:

No

result:

ok OK, Accepted.

Test #6:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

6

output:

Yes
1 1 1 1 1 1 
1 1 1 1 1 0 
1 1 1 1 0 0 
0 0 0 -1 -1 -1 
0 0 -1 -1 -1 -1 
0 -1 -1 -1 -1 -1 

result:

ok OK, Accepted.

Test #7:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

7

output:

No

result:

ok OK, Accepted.

Test #8:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

8

output:

Yes
1 1 1 1 1 1 1 1 
1 1 1 1 1 1 1 0 
1 1 1 1 1 1 0 0 
1 1 1 1 1 0 0 0 
0 0 0 0 -1 -1 -1 -1 
0 0 0 -1 -1 -1 -1 -1 
0 0 -1 -1 -1 -1 -1 -1 
0 -1 -1 -1 -1 -1 -1 -1 

result:

ok OK, Accepted.

Test #9:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

9

output:

No

result:

ok OK, Accepted.

Test #10:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

10

output:

Yes
1 1 1 1 1 1 1 1 1 1 
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 
0 0 0 0 0 -1 -1 -1 -1 -1 
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 

result:

ok OK, Accepted.

Test #11:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

21

output:

No

result:

ok OK, Accepted.

Test #12:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

37

output:

No

result:

ok OK, Accepted.

Test #13:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

73

output:

No

result:

ok OK, Accepted.

Test #14:

score: 0
Accepted
time: 0ms
memory: 6228kb

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 1 
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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: 3840kb

input:

233

output:

No

result:

ok OK, Accepted.

Test #16:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

555

output:

No

result:

ok OK, Accepted.

Test #17:

score: 0
Accepted
time: 17ms
memory: 10384kb

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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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: 32ms
memory: 11552kb

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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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: 1ms
memory: 3840kb

input:

999

output:

No

result:

ok OK, Accepted.

Test #20:

score: 0
Accepted
time: 39ms
memory: 12512kb

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