QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#269867#7629. Make SYSU Great Again IIFISHER_WA 0ms3980kbC++14595b2023-11-30 08:36:272023-11-30 08:36:28

Judging History

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

  • [2023-11-30 08:36:28]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3980kb
  • [2023-11-30 08:36:27]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000;
int v[maxn + 5][maxn + 5];
int main() {
	int n;
	scanf("%d", &n);
	int l = 1;
	while (l < n) l <<= 1;
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			if (~(i ^ j) & 1) {
				int x = (i - j) / 2 + (n - 1) / 2, y = (i + j) / 2 - 1;
				v[i][j] = x * l + y;
			}
	puts("Yes");
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			if ((i ^ j) & 1) v[i][j] = (v[i - 1][j] | v[i + 1][j] | v[i][j - 1] | v[i][j + 1]) ^ (l * l - 1);
			printf("%d ", v[i][j]);
		}
		puts("");
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4

output:

Yes
4 10 1 12 
2 5 8 2 
9 0 6 8 
4 10 0 7 

result:

ok 1

Test #2:

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

input:

1

output:

Yes
0 

result:

ok 1

Test #3:

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

input:

2

output:

Yes
0 2 
2 1 

result:

ok 1

Test #4:

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

input:

3

output:

Yes
4 10 1 
2 5 8 
9 0 6 

result:

ok 1

Test #5:

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

input:

5

output:

Yes
16 38 9 52 2 
38 17 36 10 52 
25 36 18 36 11 
4 26 36 19 32 
34 4 27 32 20 

result:

ok 1

Test #6:

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

input:

8

output:

Yes
24 38 17 36 10 52 3 56 
6 25 36 18 36 11 48 4 
33 4 26 36 19 32 12 50 
20 34 4 27 32 20 34 13 
42 20 35 0 28 34 21 32 
4 43 16 36 2 29 32 22 
51 0 44 18 37 0 30 32 
8 52 2 45 16 38 0 31 

result:

ok 1

Test #7:

score: -100
Wrong Answer
time: 0ms
memory: 3852kb

input:

13

output:

Yes
96 142 81 172 66 140 51 200 36 202 21 232 6 
142 97 140 82 172 67 136 52 202 37 200 22 232 
113 140 98 140 83 168 68 138 53 200 38 200 23 
12 114 140 99 136 84 170 69 136 54 200 39 192 
130 12 115 136 100 138 85 168 70 136 55 192 40 
108 131 8 116 138 101 136 86 168 71 128 56 198 
147 104 132 10...

result:

wrong answer The integer 136 appears more than 5 times