QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#263584#6189. Full Clue ProblemCrysflyAC ✓0ms3652kbC++171.3kb2023-11-24 23:10:472023-11-24 23:10:50

Judging History

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

  • [2023-11-24 23:10:50]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3652kb
  • [2023-11-24 23:10:47]
  • 提交

answer

// what is matter? never mind. 
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2") 
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
#define ull unsigned long long
using namespace std;
inline int read()
{
    char c=getchar();int x=0;bool f=0;
    for(;!isdigit(c);c=getchar())f^=!(c^45);
    for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
    if(f)x=-x;return x;
}

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define maxn 500005
#define inf 0x3f3f3f3f

int n,a[25][25],b[25][25],c[25][25];

signed main()
{
	n=read();
	a[0][0]=a[0][1]=a[1][1]=1;
	b[0][0]=b[1][0]=b[1][1]=1;
	For(i,2,n-1){
		a[i][i]=b[i][i]=1;
		if(i&1^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==0)c[i][j]=2;
			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: 0ms
memory: 3632kb

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

result:

ok ok

Test #2:

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

input:

2

output:

3 2
2 3
1 1
0 1
1 0
1 1

result:

ok ok

Test #3:

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

input:

3

output:

3 2 1
2 2 2
1 2 3
1 1 0
0 1 0
0 1 1
1 0 0
1 1 1
0 0 1

result:

ok ok

Test #4:

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

input:

4

output:

3 2 1 0
2 2 2 1
1 2 2 2
0 1 2 3
1 1 0 0
0 1 0 0
0 1 1 1
0 0 0 1
1 0 0 0
1 1 1 0
0 0 1 0
0 0 1 1

result:

ok ok

Test #5:

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

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

result:

ok ok

Test #6:

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

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: 3580kb

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