QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#256602 | #7629. Make SYSU Great Again II | ucup-team2580 | WA | 279ms | 28680kb | C++20 | 1.3kb | 2023-11-18 20:29:46 | 2023-11-18 20:29:47 |
Judging History
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;
}
ans[i][j]=res;
cnt[res]++;
if(cnt[res]>5) 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: 3576kb
input:
4
output:
Yes 36 8 5 0 1 20 42 21 32 3 16 40 19 4 35 4
result:
ok 1
Test #2:
score: 0
Accepted
time: 1ms
memory: 3480kb
input:
1
output:
Yes 0
result:
ok 1
Test #3:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
2
output:
Yes 4 8 1 6
result:
ok 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
3
output:
Yes 32 16 9 1 4 0 18 8 6
result:
ok 1
Test #5:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
5
output:
Yes 84 0 41 20 1 42 81 2 65 46 64 12 33 26 1 28 34 72 4 56 67 24 38 89 6
result:
ok 1
Test #6:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
8
output:
Yes 36 72 5 128 65 156 98 0 10 145 104 1 18 96 129 44 164 8 132 112 9 16 66 17 82 133 50 12 240 11 32 78 165 80 137 114 4 208 2 176 64 14 48 140 19 44 192 3 150 97 138 49 76 146 41 144 105 6 33 70 161 68 130 69
result:
ok 1
Test #7:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
13
output:
Yes 444 0 649 292 65 400 578 396 114 137 96 386 529 64 19 352 536 416 72 385 16 397 34 533 32 74 35 324 136 3 76 402 4 544 80 265 194 29 288 28 2 36 336 163 8 306 9 258 580 296 514 85 130 316 1 174 512 295 128 530 97 10 197 48 264 528 195 516 257 162 520 38 393 20 192 256 591 176 134 552 146 1...
result:
ok 1
Test #8:
score: 0
Accepted
time: 1ms
memory: 3672kb
input:
21
output:
Yes 1184 268 1617 140 593 44 338 1676 290 145 1092 393 1074 396 531 1508 0 840 52 641 352 777 1186 4 114 1292 19 1060 82 1037 66 696 2 128 49 460 528 329 1024 576 24 134 16 324 1048 388 562 456 530 288 146 45 258 1628 3 708 1027 224 512 354 17 358 513 239 1040 806 64 261 1058 265 192 1536 336 548...
result:
ok 1
Test #9:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
34
output:
Yes 4388 200 21 3008 17 1740 2322 1632 2458 1 4184 3618 273 3178 785 2124 1664 4144 844 2065 1000 1041 2850 217 2050 4293 3602 325 3104 587 2352 78 3713 336 2193 1284 2082 5 1736 4368 676 266 1540 4408 516 272 4266 276 2 4128 2314 133 1074 328 19 224 4109 0 1524 2056 65 1210 4421 2176 520 2096 12 3...
result:
ok 1
Test #10:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
55
output:
Yes 6184 384 2113 1440 8785 3200 4214 3456 8798 2465 580 6529 1566 4384 1039 6400 632 5124 8784 6533 634 9605 514 7573 522 3237 602 5121 10948 1283 10492 5378 81 7080 1025 8964 138 5745 8196 32 28 6114 2068 4616 1312 4754 8456 134 11064 133 2082 4293 34 6528 59 8787 1064 8466 4612 3210 561 11528 46...
result:
ok 1
Test #11:
score: 0
Accepted
time: 2ms
memory: 4000kb
input:
89
output:
Yes 10392 17696 13021 16384 9177 6148 554 7552 8278 22913 84 19361 4122 1312 23063 1128 18708 8896 4352 2277 28688 1445 6722 8345 20994 8633 5190 26913 5660 291 26184 4402 27277 96 29317 1280 26670 529 9216 23048 8496 16970 4148 26752 4128 26432 6206 26496 98 15632 622 17793 4126 17248 11275 17104 1...
result:
ok 1
Test #12:
score: 0
Accepted
time: 2ms
memory: 4064kb
input:
100
output:
Yes 10084 8 14341 960 10241 6108 8226 23232 1322 22545 9384 4929 18578 13576 17059 268 1120 16656 5228 17169 8200 6833 17666 105 27282 1029 39922 5 10672 1547 160 25950 6177 8320 22129 260 16098 33029 23240 33824 13060 34010 14628 32792 12132 20504 8194 23948 32786 22660 1066 18693 12922 384 6763 17...
result:
ok 1
Test #13:
score: 0
Accepted
time: 6ms
memory: 5056kb
input:
200
output:
Yes 130084 328 14341 131200 10817 132252 51810 13568 84010 37009 16488 69505 143442 99720 16931 79884 33184 137744 57516 68433 8200 135025 12418 33065 147026 5 79922 17484 33200 91659 37216 69150 28897 65792 44785 16644 135842 24581 38664 32 133060 73754 7460 155864 35620 139288 5314 26892 37010 256...
result:
ok 1
Test #14:
score: 0
Accepted
time: 12ms
memory: 6476kb
input:
300
output:
Yes 290084 32840 334341 24960 34305 293276 1634 223232 4138 262545 173096 84929 263186 190984 5219 156300 296288 143888 2348 299025 8456 295025 144258 280617 66706 320005 434 35397 328112 131659 109600 263070 255073 512 69809 147972 15586 115461 263240 157856 333060 32986 215588 33176 18980 341336 5...
result:
ok 1
Test #15:
score: 0
Accepted
time: 18ms
memory: 8156kb
input:
400
output:
Yes 450084 74056 268805 24960 170561 607644 8290 543232 229674 262289 533352 245889 266834 107912 16931 79884 443552 14352 377516 142673 37384 614513 136066 65577 307282 1029 559922 73733 530672 41227 399456 32798 95457 557056 397553 17668 135842 24581 38664 32 293060 229914 11300 476120 15396 60648...
result:
ok 1
Test #16:
score: 0
Accepted
time: 33ms
memory: 10328kb
input:
500
output:
Yes 890084 8456 54341 535296 365761 158236 33890 662144 81962 6161 247336 8321 263442 190984 69923 10764 230624 16656 884972 158993 266888 108657 542210 440361 83090 559877 484594 2053 288624 659595 265312 82846 798817 184064 69809 413508 106530 657349 6152 713824 70404 568474 16420 957144 25636 885...
result:
ok 1
Test #17:
score: 0
Accepted
time: 57ms
memory: 12900kb
input:
600
output:
Yes 290084 32840 334341 24960 1114177 294300 720994 26624 69674 262545 533096 85377 557650 354440 168483 879884 131232 1126672 787628 1119057 8200 295025 144258 869417 1082194 287749 760370 262149 690672 1078283 592480 1319966 246241 8704 430321 1133828 45218 475653 1064200 508448 1052100 393754 116...
result:
ok 1
Test #18:
score: 0
Accepted
time: 88ms
memory: 15848kb
input:
700
output:
Yes 365653 1051434 594112 1068328 823829 148488 372944 131622 1420481 675866 1093572 65587 665420 1048625 581568 401440 116446 393473 86242 1322265 98950 926792 1118501 436754 590281 1321984 184580 1117395 135456 836246 76873 1441796 600995 36932 1657625 41126 86089 926740 100905 668102 32768 420244...
result:
ok 1
Test #19:
score: 0
Accepted
time: 106ms
memory: 19420kb
input:
800
output:
Yes 1965653 131498 1102912 9128 2151509 592264 169552 26662 852801 61466 1116420 29811 2490892 124977 660992 1378336 557406 2308737 1869090 80025 49734 200072 1634853 2231570 823305 2115136 327684 1732819 34336 1200342 2099209 1270468 557091 1468804 590361 2238566 98953 808980 2196713 661766 99456 1...
result:
ok 1
Test #20:
score: 0
Accepted
time: 154ms
memory: 22988kb
input:
900
output:
Yes 1125653 2527338 1139456 3053672 1122965 803144 1214992 8294 132737 3010650 134148 1855923 2572 140593 1900672 2292768 787294 1223681 856802 2138137 219014 2926664 148901 2428946 1721417 2171520 1888260 208659 3199200 534038 1229257 605188 1098403 539716 443033 2630694 465737 1172 1837161 2204166...
result:
ok 1
Test #21:
score: 0
Accepted
time: 184ms
memory: 26656kb
input:
1000
output:
Yes 1005653 1058474 2097472 685224 264277 1295240 6224 3417382 35393 3228954 41476 2901363 1149452 684337 34304 1995040 34398 3235969 662562 3162265 595014 1468552 2201381 1320978 2166793 690752 1126660 707283 3215392 699094 2183433 1188548 891939 3162244 428825 90214 1350793 655636 1152745 286982 2...
result:
ok 1
Test #22:
score: -100
Wrong Answer
time: 279ms
memory: 28680kb
input:
1200
output:
Yes 1312339 698540 81985 4635266 3145729 4587696 3212367 4456976 2206889 5259590 3028505 4243780 2304536 5264519 428344 554119 4325464 796038 148073 67986 4890732 22787 2793620 268584 5382790 559200 4679432 1579047 4342864 3947147 32832 942386 2098889 4546834 1219209 82950 4076441 35908 1598210 1363...
result:
wrong answer The integer 1 appears more than 5 times