QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#256613#7629. Make SYSU Great Again IIucup-team2580WA 309ms28356kbC++201.3kb2023-11-18 20:32:272023-11-18 20:32:27

Judging History

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

  • [2023-11-18 20:32:27]
  • 评测
  • 测评结果:WA
  • 用时:309ms
  • 内存:28356kb
  • [2023-11-18 20:32:27]
  • 提交

answer

//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
int ans[2002][2002];
int cnt[4004000];
mt19937 rnd(time(NULL));
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
		{
			int rm=((1<<30)-1)^(ans[i-1][j]|ans[i][j-1]);
			int res=-1;
			for(int x=0;x<20;x++)
			{
				int cho=(rnd()%(4*n*n))&rm;
				if(res==-1||cnt[cho]<cnt[res])
					res=cho;
			}
			assert((res&ans[i-1][j])==0);
			assert((res&ans[i][j-1])==0);
			ans[i][j]=res;
			cnt[res]++;
			if(cnt[res]>5||res==-1) die("No");
		}
	cout<<"Yes"<<endl;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
			cout<<ans[i][j]<<" ";
		cout<<'\n';
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3588kb

input:

4

output:

Yes
34 29 2 25 
13 32 4 0 
48 9 16 45 
12 50 5 18 

result:

ok 1

Test #2:

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

input:

1

output:

Yes
2 

result:

ok 1

Test #3:

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

input:

2

output:

Yes
2 13 
8 0 

result:

ok 1

Test #4:

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

input:

3

output:

Yes
2 5 10 
13 32 20 
0 14 1 

result:

ok 1

Test #5:

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

input:

5

output:

Yes
10 37 2 73 34 
0 8 52 0 1 
7 64 11 68 24 
56 6 48 3 36 
65 40 70 16 75 

result:

ok 1

Test #6:

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

input:

8

output:

Yes
162 29 66 25 230 8 196 34 
17 224 13 64 0 55 8 193 
70 9 160 6 16 200 38 24 
136 50 5 152 2 49 72 135 
51 76 176 7 48 74 148 104 
192 33 14 80 4 1 32 145 
59 132 96 142 112 128 85 40 
68 56 3 0 131 28 2 69 

result:

ok 1

Test #7:

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

input:

13

output:

Yes
530 45 82 645 58 452 40 534 161 92 643 268 560 
41 512 44 322 1 16 385 8 262 32 12 33 394 
402 73 514 153 4 482 528 387 600 131 288 214 544 
36 2 289 70 296 20 9 84 35 524 192 257 86 
456 17 516 184 0 67 164 266 132 256 63 640 264 
567 64 176 324 568 384 537 228 11 196 0 21 546 
72 549 10 160 32...

result:

ok 1

Test #8:

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

input:

21

output:

Yes
38 1625 390 1033 1014 1024 436 514 1261 784 47 1408 580 1307 64 447 576 63 704 29 1632 
88 262 1080 448 1 710 1025 304 512 1220 768 26 33 708 32 1600 443 1536 45 1154 257 
166 72 260 1065 516 265 662 1032 434 8 1184 68 528 1059 280 3 1028 130 1360 548 90 
593 160 19 256 1248 16 296 80 1548 464 5...

result:

ok 1

Test #9:

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

input:

34

output:

Yes
3218 4429 146 4457 2198 1576 260 1538 2521 1056 399 576 396 531 3080 4307 1028 2115 904 3185 644 1090 317 3712 89 1058 2905 128 1074 265 660 3402 0 447 
549 16 4192 2706 1128 129 3138 4109 546 2124 4128 3477 608 1036 563 8 2914 12 4112 386 2049 176 2048 307 4224 2632 162 3148 4097 166 4424 181 4...

result:

ok 1

Test #10:

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

input:

55

output:

Yes
8610 1609 2230 4873 1234 4876 2224 4686 3457 4692 2339 9292 160 4447 8736 2515 1024 4327 11288 5089 3084 9138 65 3856 69 9482 6277 848 2082 4753 256 8194 3356 99 4360 3264 4650 1425 8750 3073 8558 3201 8278 5512 112 3081 4756 1355 10756 1336 198 512 5492 138 5185 
2641 4 9793 2198 8 3235 8196 14...

result:

ok 1

Test #11:

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

input:

89

output:

Yes
23714 277 15594 17157 14378 596 7432 24674 3201 380 16003 292 30784 1599 26816 5926 10249 17458 332 4769 26944 5122 24945 5768 26917 4810 24853 1088 11182 5185 25244 6210 24888 4611 16416 1808 2050 21177 11266 4953 3206 537 26658 1156 4440 19493 4608 10731 1540 16480 7826 8552 18948 5546 10837 4...

result:

ok 1

Test #12:

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

input:

100

output:

Yes
24610 7261 17058 3161 16678 37064 1284 37026 3865 4192 911 7184 16748 36371 4296 33795 6868 25859 2728 32785 8260 19506 9165 7200 729 3362 12505 34560 16402 6185 9044 1162 4128 26655 96 32000 50 713 35094 28905 2578 38349 27138 28 12736 19973 32880 24591 6320 9476 6850 284 23072 9474 22741 8194 ...

result:

ok 1

Test #13:

score: 0
Accepted
time: 6ms
memory: 5012kb

input:

200

output:

Yes
104610 29 140194 3161 98726 4168 34180 84514 5529 84064 911 127056 134700 24851 69128 45251 82708 4227 10792 70737 57604 3186 49165 6560 83545 40994 135833 27648 70034 42089 133140 87882 2080 70751 59552 69888 19506 78665 150678 12393 82578 36941 75650 39004 90624 7493 74416 56335 8368 1284 1352...

result:

ok 1

Test #14:

score: 0
Accepted
time: 11ms
memory: 6460kb

input:

300

output:

Yes
184610 262685 59682 66073 33254 83976 12804 117794 135321 68896 40975 214800 2156 74387 283720 10627 116244 4483 90664 296401 14340 65714 9037 135200 43801 201954 43545 86080 296594 213289 10964 87306 174624 66911 63648 131584 92530 296073 154134 106857 134674 356813 2562 77980 320 112261 133424...

result:

ok 1

Test #15:

score: 0
Accepted
time: 18ms
memory: 8156kb

input:

400

output:

Yes
584610 69661 140194 3161 577702 336456 182404 274466 3993 241760 911 447568 2604 635923 131080 273859 135188 386435 137768 99665 542724 505714 13 535712 245849 267042 189593 2048 414610 525417 133140 87882 2080 550751 39072 549888 494386 525385 110998 279145 77970 49229 395650 95836 559360 47981...

result:

ok 1

Test #16:

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

input:

500

output:

Yes
104610 271709 708770 336217 690342 4168 238340 528418 279705 67680 911 926800 98732 817747 165000 342787 656532 299331 671912 113169 131396 576690 66317 55456 132953 82082 135705 107776 16402 966185 340 169610 811360 99487 157984 792064 98482 400713 114838 139625 3602 876813 40066 155932 68160 3...

result:

ok 1

Test #17:

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

input:

600

output:

Yes
904610 143901 640418 401497 98726 803912 1157252 17954 168089 527200 1118351 542032 1081388 796435 184328 273859 1196564 70019 806440 229457 538884 1147506 270349 593568 405849 590882 1190297 345600 1048978 277609 180756 73034 172576 66911 63648 853504 1237042 852297 155286 827753 1181842 30285 ...

result:

ok 1

Test #18:

score: 0
Accepted
time: 88ms
memory: 17600kb

input:

700

output:

Yes
824610 207517 300066 205785 527398 1557064 7556 1114210 8089 1843296 201999 846544 1179692 316435 657544 1433859 7380 705283 275560 33297 608260 397938 1091853 655456 1072537 393826 62617 1837888 33938 725033 288852 1081738 402528 18591 504672 1067008 525170 1319945 4950 1228841 274706 706573 10...

result:

ok 1

Test #19:

score: 0
Accepted
time: 123ms
memory: 19132kb

input:

800

output:

Yes
2504610 1589277 371618 544857 1214630 553544 2425988 1718306 100249 1458272 593807 1200208 3628 1273875 264200 1291715 2097172 213379 39464 1508689 2052 1787762 2140173 1134752 393305 530210 1206425 790528 1172370 658537 114708 8010 1998880 26463 1343648 750592 1049394 791625 2288022 332393 1108...

result:

ok 1

Test #20:

score: 0
Accepted
time: 142ms
memory: 22932kb

input:

900

output:

Yes
2464160 1189395 526408 2593153 1065488 502212 2641962 1549525 545536 2468997 1069898 862240 2248789 339584 1233168 591912 1202055 632936 1446150 41576 196739 2656016 94441 1084934 524705 12800 2476343 533504 1348105 2182386 1740801 82634 1707296 2368128 677989 361608 17153 1417274 2629572 204801...

result:

ok 1

Test #21:

score: 0
Accepted
time: 195ms
memory: 27460kb

input:

1000

output:

Yes
2904160 76563 53448 2172673 1871888 2190724 135274 2378389 689152 1395205 557066 469792 32981 3219200 671888 2145576 1901191 2107752 115718 3672104 398659 1149456 2503849 1655622 400417 2654272 1123511 2134272 1459209 12850 2064449 2107914 1315168 625152 410021 3684872 99393 3416122 248964 12353...

result:

ok 1

Test #22:

score: -100
Wrong Answer
time: 309ms
memory: 28356kb

input:

1200

output:

Yes
1772741 286720 2818307 25112 3316197 75288 3330150 528009 36 1722841 328196 5287195 201312 10255 1232928 75585 6160 336878 2627585 1377328 700609 2182966 4501577 3687552 432642 4268201 2661894 1196504 898054 149849 1314982 172880 281645 3149954 270360 1708544 2195809 1967236 108913 5128832 32246...

result:

wrong answer There exist two adjacent numbers whose bitwise AND value is greater than 0.