QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#248811#7629. Make SYSU Great Again IIucup-team197#AC ✓203ms19244kbC++141.2kb2023-11-11 21:56:572023-11-11 21:56:59

Judging History

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

  • [2023-11-11 21:56:59]
  • 评测
  • 测评结果:AC
  • 用时:203ms
  • 内存:19244kb
  • [2023-11-11 21:56:57]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
int n;
int ans[2001][2001];
int main(){
	ios::sync_with_stdio(false);
	cin >> n;
	for(int i=1; i<=n ;i++){
		for(int j=1; j<=n ;j++){
			if((i+j)%2) ans[i][j]=1;
		}
	}
	int mxr=0;
	while((1<<(mxr+1))<=n) mxr++;
	for(int r=0; r<=mxr ;r++){
		int cur=0;
		for(int j=1; j<=n ;j++){
			if((j&-j)==(1<<r)){
				cur^=1;continue;
			}
			for(int i=1; i<=n ;i++){
				if((i+j)%2==cur) ans[i][j]^=(1<<(r+1));
			}
		}
	}
	for(int r=0; r<=mxr-1 ;r++){
		int cur=0;
		for(int j=1; j<=n ;j++){
			if((j&-j)==(1<<r)){
				cur^=1;continue;
			}
			for(int i=1; i<=n ;i++){
				if((i+j)%2==cur) ans[j][i]^=(1<<(r+2+mxr));
			}
		}
	}
	map<int,int>mp;
	cout << "Yes\n";
	for(int i=1; i<=n ;i++){
		for(int j=1; j<=n ;j++){
			cout << ans[i][j] << ' ';
			//mp[ans[i][j]]++;
		}
		cout << '\n';
	}
	int res=0;
	for(auto c:mp) res=max(res,c.second);
	//cout << res << endl;
	/*
	for(int i=1; i<=n ;i++){
		for(int j=1; j<=n ;j++){
			cout << (ans[i][j]&ans[i][j-1]) << ' ';
		}
		cout << '\n';
	}
	
	for(int i=1; i<=n ;i++){
		for(int j=1; j<=n ;j++){
			cout << (ans[i][j]&ans[i-1][j]) << ' ';
		}
		cout << '\n';
	}*/
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4

output:

Yes
44 3 40 5 
17 8 21 2 
12 35 8 37 
33 24 37 18 

result:

ok 1

Test #2:

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

input:

1

output:

Yes
0 

result:

ok 1

Test #3:

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

input:

2

output:

Yes
4 3 
9 0 

result:

ok 1

Test #4:

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

input:

3

output:

Yes
4 3 0 
9 0 13 
4 3 0 

result:

ok 1

Test #5:

score: 0
Accepted
time: 1ms
memory: 5856kb

input:

5

output:

Yes
44 3 40 5 32 
17 8 21 2 29 
12 35 8 37 0 
33 24 37 18 45 
12 35 8 37 0 

result:

ok 1

Test #6:

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

input:

8

output:

Yes
220 3 216 5 208 11 212 9 
33 152 37 146 45 144 41 134 
156 67 152 69 144 75 148 73 
65 56 69 50 77 48 73 38 
28 195 24 197 16 203 20 201 
161 24 165 18 173 16 169 6 
92 131 88 133 80 139 84 137 
129 120 133 114 141 112 137 102 

result:

ok 1

Test #7:

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

input:

13

output:

Yes
220 3 216 5 208 11 212 9 196 27 192 21 200 
33 152 37 146 45 144 41 134 57 128 61 130 53 
156 67 152 69 144 75 148 73 132 91 128 85 136 
65 56 69 50 77 48 73 38 89 32 93 34 85 
28 195 24 197 16 203 20 201 4 219 0 213 8 
161 24 165 18 173 16 169 6 185 0 189 2 181 
92 131 88 133 80 139 84 137 68 1...

result:

ok 1

Test #8:

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

input:

21

output:

Yes
956 3 952 5 944 11 948 9 932 27 928 21 936 19 940 17 908 51 904 53 896 
65 824 69 818 77 816 73 806 89 800 93 802 85 808 81 782 113 776 117 770 125 
828 131 824 133 816 139 820 137 804 155 800 149 808 147 812 145 780 179 776 181 768 
129 632 133 626 141 624 137 614 153 608 157 610 149 616 145 59...

result:

ok 1

Test #9:

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

input:

34

output:

Yes
3964 3 3960 5 3952 11 3956 9 3940 27 3936 21 3944 19 3948 17 3916 51 3912 53 3904 59 3908 41 3924 43 3920 37 3928 35 3932 33 3868 99 
129 3704 133 3698 141 3696 137 3686 153 3680 157 3682 149 3688 145 3662 177 3656 181 3650 189 3648 185 3654 169 3664 173 3666 165 3672 161 3614 225 3608 
3708 259...

result:

ok 1

Test #10:

score: 0
Accepted
time: 1ms
memory: 3764kb

input:

55

output:

Yes
3964 3 3960 5 3952 11 3956 9 3940 27 3936 21 3944 19 3948 17 3916 51 3912 53 3904 59 3908 41 3924 43 3920 37 3928 35 3932 33 3868 99 3864 101 3856 107 3860 105 3844 123 3840 117 3848 115 3852 81 3884 83 3880 85 3872 91 3876 
129 3704 133 3698 141 3696 137 3686 153 3680 157 3682 149 3688 145 3662...

result:

ok 1

Test #11:

score: 0
Accepted
time: 1ms
memory: 6208kb

input:

89

output:

Yes
16124 3 16120 5 16112 11 16116 9 16100 27 16096 21 16104 19 16108 17 16076 51 16072 53 16064 59 16068 41 16084 43 16080 37 16088 35 16092 33 16028 99 16024 101 16016 107 16020 105 16004 123 16000 117 16008 115 16012 81 16044 83 16040 85 16032 91 16036 73 16052 75 16048 69 16056 67 16060 65 15932...

result:

ok 1

Test #12:

score: 0
Accepted
time: 1ms
memory: 4056kb

input:

100

output:

Yes
16124 3 16120 5 16112 11 16116 9 16100 27 16096 21 16104 19 16108 17 16076 51 16072 53 16064 59 16068 41 16084 43 16080 37 16088 35 16092 33 16028 99 16024 101 16016 107 16020 105 16004 123 16000 117 16008 115 16012 81 16044 83 16040 85 16032 91 16036 73 16052 75 16048 69 16056 67 16060 65 15932...

result:

ok 1

Test #13:

score: 0
Accepted
time: 3ms
memory: 4552kb

input:

200

output:

Yes
65020 3 65016 5 65008 11 65012 9 64996 27 64992 21 65000 19 65004 17 64972 51 64968 53 64960 59 64964 41 64980 43 64976 37 64984 35 64988 33 64924 99 64920 101 64912 107 64916 105 64900 123 64896 117 64904 115 64908 81 64940 83 64936 85 64928 91 64932 73 64948 75 64944 69 64952 67 64956 65 64828...

result:

ok 1

Test #14:

score: 0
Accepted
time: 2ms
memory: 6812kb

input:

300

output:

Yes
261116 3 261112 5 261104 11 261108 9 261092 27 261088 21 261096 19 261100 17 261068 51 261064 53 261056 59 261060 41 261076 43 261072 37 261080 35 261084 33 261020 99 261016 101 261008 107 261012 105 260996 123 260992 117 261000 115 261004 81 261036 83 261032 85 261024 91 261028 73 261044 75 261...

result:

ok 1

Test #15:

score: 0
Accepted
time: 9ms
memory: 6776kb

input:

400

output:

Yes
261116 3 261112 5 261104 11 261108 9 261092 27 261088 21 261096 19 261100 17 261068 51 261064 53 261056 59 261060 41 261076 43 261072 37 261080 35 261084 33 261020 99 261016 101 261008 107 261012 105 260996 123 260992 117 261000 115 261004 81 261036 83 261032 85 261024 91 261028 73 261044 75 261...

result:

ok 1

Test #16:

score: 0
Accepted
time: 10ms
memory: 7748kb

input:

500

output:

Yes
261116 3 261112 5 261104 11 261108 9 261092 27 261088 21 261096 19 261100 17 261068 51 261064 53 261056 59 261060 41 261076 43 261072 37 261080 35 261084 33 261020 99 261016 101 261008 107 261012 105 260996 123 260992 117 261000 115 261004 81 261036 83 261032 85 261024 91 261028 73 261044 75 261...

result:

ok 1

Test #17:

score: 0
Accepted
time: 20ms
memory: 8264kb

input:

600

output:

Yes
1046524 3 1046520 5 1046512 11 1046516 9 1046500 27 1046496 21 1046504 19 1046508 17 1046476 51 1046472 53 1046464 59 1046468 41 1046484 43 1046480 37 1046488 35 1046492 33 1046428 99 1046424 101 1046416 107 1046420 105 1046404 123 1046400 117 1046408 115 1046412 81 1046444 83 1046440 85 1046432...

result:

ok 1

Test #18:

score: 0
Accepted
time: 27ms
memory: 10216kb

input:

700

output:

Yes
1046524 3 1046520 5 1046512 11 1046516 9 1046500 27 1046496 21 1046504 19 1046508 17 1046476 51 1046472 53 1046464 59 1046468 41 1046484 43 1046480 37 1046488 35 1046492 33 1046428 99 1046424 101 1046416 107 1046420 105 1046404 123 1046400 117 1046408 115 1046412 81 1046444 83 1046440 85 1046432...

result:

ok 1

Test #19:

score: 0
Accepted
time: 28ms
memory: 11512kb

input:

800

output:

Yes
1046524 3 1046520 5 1046512 11 1046516 9 1046500 27 1046496 21 1046504 19 1046508 17 1046476 51 1046472 53 1046464 59 1046468 41 1046484 43 1046480 37 1046488 35 1046492 33 1046428 99 1046424 101 1046416 107 1046420 105 1046404 123 1046400 117 1046408 115 1046412 81 1046444 83 1046440 85 1046432...

result:

ok 1

Test #20:

score: 0
Accepted
time: 37ms
memory: 11572kb

input:

900

output:

Yes
1046524 3 1046520 5 1046512 11 1046516 9 1046500 27 1046496 21 1046504 19 1046508 17 1046476 51 1046472 53 1046464 59 1046468 41 1046484 43 1046480 37 1046488 35 1046492 33 1046428 99 1046424 101 1046416 107 1046420 105 1046404 123 1046400 117 1046408 115 1046412 81 1046444 83 1046440 85 1046432...

result:

ok 1

Test #21:

score: 0
Accepted
time: 50ms
memory: 12384kb

input:

1000

output:

Yes
1046524 3 1046520 5 1046512 11 1046516 9 1046500 27 1046496 21 1046504 19 1046508 17 1046476 51 1046472 53 1046464 59 1046468 41 1046484 43 1046480 37 1046488 35 1046492 33 1046428 99 1046424 101 1046416 107 1046420 105 1046404 123 1046400 117 1046408 115 1046412 81 1046444 83 1046440 85 1046432...

result:

ok 1

Test #22:

score: 0
Accepted
time: 74ms
memory: 14108kb

input:

1200

output:

Yes
4190204 3 4190200 5 4190192 11 4190196 9 4190180 27 4190176 21 4190184 19 4190188 17 4190156 51 4190152 53 4190144 59 4190148 41 4190164 43 4190160 37 4190168 35 4190172 33 4190108 99 4190104 101 4190096 107 4190100 105 4190084 123 4190080 117 4190088 115 4190092 81 4190124 83 4190120 85 4190112...

result:

ok 1

Test #23:

score: 0
Accepted
time: 99ms
memory: 15612kb

input:

1400

output:

Yes
4190204 3 4190200 5 4190192 11 4190196 9 4190180 27 4190176 21 4190184 19 4190188 17 4190156 51 4190152 53 4190144 59 4190148 41 4190164 43 4190160 37 4190168 35 4190172 33 4190108 99 4190104 101 4190096 107 4190100 105 4190084 123 4190080 117 4190088 115 4190092 81 4190124 83 4190120 85 4190112...

result:

ok 1

Test #24:

score: 0
Accepted
time: 138ms
memory: 17184kb

input:

1600

output:

Yes
4190204 3 4190200 5 4190192 11 4190196 9 4190180 27 4190176 21 4190184 19 4190188 17 4190156 51 4190152 53 4190144 59 4190148 41 4190164 43 4190160 37 4190168 35 4190172 33 4190108 99 4190104 101 4190096 107 4190100 105 4190084 123 4190080 117 4190088 115 4190092 81 4190124 83 4190120 85 4190112...

result:

ok 1

Test #25:

score: 0
Accepted
time: 178ms
memory: 18056kb

input:

1800

output:

Yes
4190204 3 4190200 5 4190192 11 4190196 9 4190180 27 4190176 21 4190184 19 4190188 17 4190156 51 4190152 53 4190144 59 4190148 41 4190164 43 4190160 37 4190168 35 4190172 33 4190108 99 4190104 101 4190096 107 4190100 105 4190084 123 4190080 117 4190088 115 4190092 81 4190124 83 4190120 85 4190112...

result:

ok 1

Test #26:

score: 0
Accepted
time: 188ms
memory: 18708kb

input:

1900

output:

Yes
4190204 3 4190200 5 4190192 11 4190196 9 4190180 27 4190176 21 4190184 19 4190188 17 4190156 51 4190152 53 4190144 59 4190148 41 4190164 43 4190160 37 4190168 35 4190172 33 4190108 99 4190104 101 4190096 107 4190100 105 4190084 123 4190080 117 4190088 115 4190092 81 4190124 83 4190120 85 4190112...

result:

ok 1

Test #27:

score: 0
Accepted
time: 194ms
memory: 18496kb

input:

1920

output:

Yes
4190204 3 4190200 5 4190192 11 4190196 9 4190180 27 4190176 21 4190184 19 4190188 17 4190156 51 4190152 53 4190144 59 4190148 41 4190164 43 4190160 37 4190168 35 4190172 33 4190108 99 4190104 101 4190096 107 4190100 105 4190084 123 4190080 117 4190088 115 4190092 81 4190124 83 4190120 85 4190112...

result:

ok 1

Test #28:

score: 0
Accepted
time: 203ms
memory: 19244kb

input:

2000

output:

Yes
4190204 3 4190200 5 4190192 11 4190196 9 4190180 27 4190176 21 4190184 19 4190188 17 4190156 51 4190152 53 4190144 59 4190148 41 4190164 43 4190160 37 4190168 35 4190172 33 4190108 99 4190104 101 4190096 107 4190100 105 4190084 123 4190080 117 4190088 115 4190092 81 4190124 83 4190120 85 4190112...

result:

ok 1

Test #29:

score: 0
Accepted
time: 1ms
memory: 3792kb

input:

62

output:

Yes
3964 3 3960 5 3952 11 3956 9 3940 27 3936 21 3944 19 3948 17 3916 51 3912 53 3904 59 3908 41 3924 43 3920 37 3928 35 3932 33 3868 99 3864 101 3856 107 3860 105 3844 123 3840 117 3848 115 3852 81 3884 83 3880 85 3872 91 3876 73 3892 75 3888 69 3896 67 
129 3704 133 3698 141 3696 137 3686 153 3680...

result:

ok 1

Test #30:

score: 0
Accepted
time: 2ms
memory: 5872kb

input:

130

output:

Yes
65020 3 65016 5 65008 11 65012 9 64996 27 64992 21 65000 19 65004 17 64972 51 64968 53 64960 59 64964 41 64980 43 64976 37 64984 35 64988 33 64924 99 64920 101 64912 107 64916 105 64900 123 64896 117 64904 115 64908 81 64940 83 64936 85 64928 91 64932 73 64948 75 64944 69 64952 67 64956 65 64828...

result:

ok 1

Test #31:

score: 0
Accepted
time: 1ms
memory: 6048kb

input:

126

output:

Yes
16124 3 16120 5 16112 11 16116 9 16100 27 16096 21 16104 19 16108 17 16076 51 16072 53 16064 59 16068 41 16084 43 16080 37 16088 35 16092 33 16028 99 16024 101 16016 107 16020 105 16004 123 16000 117 16008 115 16012 81 16044 83 16040 85 16032 91 16036 73 16052 75 16048 69 16056 67 16060 65 15932...

result:

ok 1

Test #32:

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

input:

66

output:

Yes
16124 3 16120 5 16112 11 16116 9 16100 27 16096 21 16104 19 16108 17 16076 51 16072 53 16064 59 16068 41 16084 43 16080 37 16088 35 16092 33 16028 99 16024 101 16016 107 16020 105 16004 123 16000 117 16008 115 16012 81 16044 83 16040 85 16032 91 16036 73 16052 75 16048 69 16056 67 16060 65 15932...

result:

ok 1

Test #33:

score: 0
Accepted
time: 53ms
memory: 12508kb

input:

1021

output:

Yes
1046524 3 1046520 5 1046512 11 1046516 9 1046500 27 1046496 21 1046504 19 1046508 17 1046476 51 1046472 53 1046464 59 1046468 41 1046484 43 1046480 37 1046488 35 1046492 33 1046428 99 1046424 101 1046416 107 1046420 105 1046404 123 1046400 117 1046408 115 1046412 81 1046444 83 1046440 85 1046432...

result:

ok 1

Test #34:

score: 0
Accepted
time: 46ms
memory: 12352kb

input:

1022

output:

Yes
1046524 3 1046520 5 1046512 11 1046516 9 1046500 27 1046496 21 1046504 19 1046508 17 1046476 51 1046472 53 1046464 59 1046468 41 1046484 43 1046480 37 1046488 35 1046492 33 1046428 99 1046424 101 1046416 107 1046420 105 1046404 123 1046400 117 1046408 115 1046412 81 1046444 83 1046440 85 1046432...

result:

ok 1

Test #35:

score: 0
Accepted
time: 55ms
memory: 11480kb

input:

1023

output:

Yes
1046524 3 1046520 5 1046512 11 1046516 9 1046500 27 1046496 21 1046504 19 1046508 17 1046476 51 1046472 53 1046464 59 1046468 41 1046484 43 1046480 37 1046488 35 1046492 33 1046428 99 1046424 101 1046416 107 1046420 105 1046404 123 1046400 117 1046408 115 1046412 81 1046444 83 1046440 85 1046432...

result:

ok 1

Test #36:

score: 0
Accepted
time: 56ms
memory: 12988kb

input:

1024

output:

Yes
4190204 3 4190200 5 4190192 11 4190196 9 4190180 27 4190176 21 4190184 19 4190188 17 4190156 51 4190152 53 4190144 59 4190148 41 4190164 43 4190160 37 4190168 35 4190172 33 4190108 99 4190104 101 4190096 107 4190100 105 4190084 123 4190080 117 4190088 115 4190092 81 4190124 83 4190120 85 4190112...

result:

ok 1

Test #37:

score: 0
Accepted
time: 61ms
memory: 12672kb

input:

1025

output:

Yes
4190204 3 4190200 5 4190192 11 4190196 9 4190180 27 4190176 21 4190184 19 4190188 17 4190156 51 4190152 53 4190144 59 4190148 41 4190164 43 4190160 37 4190168 35 4190172 33 4190108 99 4190104 101 4190096 107 4190100 105 4190084 123 4190080 117 4190088 115 4190092 81 4190124 83 4190120 85 4190112...

result:

ok 1

Test #38:

score: 0
Accepted
time: 56ms
memory: 11876kb

input:

1026

output:

Yes
4190204 3 4190200 5 4190192 11 4190196 9 4190180 27 4190176 21 4190184 19 4190188 17 4190156 51 4190152 53 4190144 59 4190148 41 4190164 43 4190160 37 4190168 35 4190172 33 4190108 99 4190104 101 4190096 107 4190100 105 4190084 123 4190080 117 4190088 115 4190092 81 4190124 83 4190120 85 4190112...

result:

ok 1

Test #39:

score: 0
Accepted
time: 57ms
memory: 12968kb

input:

1027

output:

Yes
4190204 3 4190200 5 4190192 11 4190196 9 4190180 27 4190176 21 4190184 19 4190188 17 4190156 51 4190152 53 4190144 59 4190148 41 4190164 43 4190160 37 4190168 35 4190172 33 4190108 99 4190104 101 4190096 107 4190100 105 4190084 123 4190080 117 4190088 115 4190092 81 4190124 83 4190120 85 4190112...

result:

ok 1

Extra Test:

score: 0
Extra Test Passed