QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#263587 | #6189. Full Clue Problem | Crysfly | AC ✓ | 1ms | 3548kb | C++17 | 593b | 2023-11-24 23:12:53 | 2023-11-24 23:12:55 |
Judging History
answer
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
using namespace std;
int n,a[25][25],b[25][25],c[25][25];
int main(){
cin>>n;
a[0][0]=b[0][0]=1;
For(i,1,n-1){
a[i][i]=b[i][i]=1;
if(i&1)a[i][i-1]=b[i-1][i]=1;
else a[i-1][i]=b[i][i-1]=1;
}
For(i,0,n-1)
For(j,0,n-1){
int d=abs(i-j);
if(d<=1)c[i][j]=2;
if(d==2)c[i][j]=1;
}
c[0][0]=c[n-1][n-1]=3;
For(i,0,n-1)For(j,0,n-1)cout<<c[i][j]<<" \n"[j==n-1];
For(i,0,n-1)For(j,0,n-1)cout<<a[i][j]<<" \n"[j==n-1];
For(i,0,n-1)For(j,0,n-1)cout<<b[i][j]<<" \n"[j==n-1];
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3380kb
input:
5
output:
3 2 1 0 0 2 2 2 1 0 1 2 2 2 1 0 1 2 2 2 0 0 1 2 3 1 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 1 1
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
2
output:
3 2 2 3 1 0 1 1 1 1 0 1
result:
ok ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
3
output:
3 2 1 2 2 2 1 2 3 1 0 0 1 1 1 0 0 1 1 1 0 0 1 0 0 1 1
result:
ok ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
4
output:
3 2 1 0 2 2 2 1 1 2 2 2 0 1 2 3 1 0 0 0 1 1 1 0 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 0 0 1 1 1 0 0 0 1
result:
ok ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3364kb
input:
10
output:
3 2 1 0 0 0 0 0 0 0 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 0 0 0 0 0 0 0 1 2 3 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 ...
result:
ok ok
Test #6:
score: 0
Accepted
time: 0ms
memory: 3340kb
input:
19
output:
3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 ...
result:
ok ok
Test #7:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
20
output:
3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 ...
result:
ok ok