QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#256616 | #7629. Make SYSU Great Again II | ucup-team2580 | AC ✓ | 987ms | 80024kb | C++20 | 1.3kb | 2023-11-18 20:33:05 | 2023-11-18 20:33:06 |
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[16004000];
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;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3580kb
input:
4
output:
Yes 25 4 34 12 0 56 5 18 9 6 24 1 52 8 37 16
result:
ok 1
Test #2:
score: 0
Accepted
time: 0ms
memory: 3432kb
input:
1
output:
Yes 1
result:
ok 1
Test #3:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
2
output:
Yes 9 4 6 8
result:
ok 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
3
output:
Yes 17 12 2 14 1 20 16 34 9
result:
ok 1
Test #5:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
5
output:
Yes 5 96 2 56 1 80 4 41 64 0 8 51 68 57 66 53 72 34 0 52 74 48 9 32 67
result:
ok 1
Test #6:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
8
output:
Yes 25 132 98 140 17 172 1 86 64 11 20 67 164 81 142 0 30 160 9 180 8 2 112 143 65 22 192 3 68 161 4 80 24 129 34 12 178 76 50 133 195 28 193 32 13 130 72 16 36 128 58 69 162 92 33 200 131 100 1 26 5 34 156 35
result:
ok 1
Test #7:
score: 0
Accepted
time: 1ms
memory: 3492kb
input:
13
output:
Yes 437 0 566 192 1 352 157 98 145 44 209 298 149 64 22 73 306 516 129 34 525 258 128 260 592 296 32 137 272 5 322 40 452 48 12 369 130 256 594 69 290 77 530 172 259 16 331 160 6 328 146 257 442 576 432 72 515 8 197 560 334 161 18 580 10 4 401 512 291 220 547 280 193 544 278 105 144 288 385 51...
result:
ok 1
Test #8:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
21
output:
Yes 125 256 622 1152 73 1172 833 138 1317 656 1289 242 517 1304 198 273 1606 400 613 266 1749 1154 84 1024 3 528 72 1156 65 144 271 720 1025 120 514 265 38 272 1130 128 580 0 849 1056 135 280 129 788 67 1040 10 752 2 608 257 4 736 1041 140 784 1029 314 1600 36 395 64 1542 32 1027 808 7 352 5 424 ...
result:
ok 1
Test #9:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
34
output:
Yes 2313 1108 2466 1116 2561 108 3713 54 713 3108 192 2063 1216 573 2498 45 4288 2 1109 2474 1045 2058 1540 328 551 3336 512 4225 532 3393 130 2409 1556 2273 1682 4393 1536 4096 502 3585 306 520 1026 536 2084 1744 2305 1218 53 1856 2074 453 4106 68 128 289 2048 1665 2328 676 1049 2658 1416 544 2068...
result:
ok 1
Test #10:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
55
output:
Yes 9305 2432 1034 4132 8201 2080 8705 4446 8193 1664 6177 2006 4105 2448 6 5361 10758 5528 8225 1354 10789 4098 10116 48 10435 536 8420 529 9288 2741 5442 545 3328 8841 2418 4741 2066 1028 6842 1285 226 11540 4299 2868 5184 2318 5329 2606 5313 4 2802 9480 626 7432 628 2304 4733 2048 385 1556 4545 ...
result:
ok 1
Test #11:
score: 0
Accepted
time: 2ms
memory: 4024kb
input:
89
output:
Yes 26261 4128 9802 22784 8301 4864 25673 2326 12521 2576 4489 11874 16393 14992 1030 8649 5122 524 19777 570 16517 2410 4112 10572 5171 2048 28892 2849 16604 12545 2122 901 1112 4869 16394 6277 24882 2252 8194 16565 5962 8196 16507 9732 6160 9190 2065 25446 2177 29784 390 23568 8418 17680 8937 1296...
result:
ok 1
Test #12:
score: 0
Accepted
time: 2ms
memory: 4140kb
input:
100
output:
Yes 26905 196 39202 12 36689 172 21825 34966 4425 33412 18457 38342 2609 20940 33794 6237 33538 2288 5125 32954 5 6858 52 21512 11079 1192 2832 17409 35300 4097 19554 4121 27012 4673 17570 333 26802 1092 24864 197 25122 35292 35 10700 20992 34294 6145 190 29441 104 10898 5472 6 33656 16385 5808 1875...
result:
ok 1
Test #13:
score: 0
Accepted
time: 6ms
memory: 5156kb
input:
200
output:
Yes 26905 103556 158306 69772 156689 98988 141313 16982 6409 33412 138585 115206 9649 20556 33922 6237 33538 89264 261 37050 5 46858 84212 139272 24391 65576 42832 88193 132644 75969 37922 18521 107012 21889 610 56333 65778 2308 106610 16517 105250 155804 32867 10636 21056 74806 4609 126334 135680 6...
result:
ok 1
Test #14:
score: 0
Accepted
time: 10ms
memory: 6460kb
input:
300
output:
Yes 66905 47108 279330 7372 229393 10796 53633 75862 4361 157764 99097 19526 143409 52748 262274 127261 132162 322480 132101 65978 134213 323722 66100 21512 231559 28776 262288 97281 33380 283649 2146 263577 107012 150593 69666 191309 66738 26692 202290 8581 16930 339420 32803 90700 263168 233782 28...
result:
ok 1
Test #15:
score: 0
Accepted
time: 21ms
memory: 8248kb
input:
400
output:
Yes 346905 524420 319330 139404 316689 131244 301825 16470 310025 214148 262489 15878 196785 304204 130 327261 65794 442544 534533 197050 5 526858 82420 141320 22343 237608 6224 255361 264740 234945 34 183641 74244 149633 1634 55309 337650 2308 586866 131461 265250 53660 99 330636 181312 73782 55936...
result:
ok 1
Test #16:
score: 0
Accepted
time: 37ms
memory: 10368kb
input:
500
output:
Yes 466905 8196 711138 8204 836689 6444 419521 557078 202185 286724 36953 878342 241 20748 589890 47261 739138 297008 550341 100410 132549 635402 19508 242056 1607 481448 33104 617089 168036 548993 34658 589849 157188 823361 158882 590093 142514 377604 524466 340485 656546 264732 570851 2060 431424 ...
result:
ok 1
Test #17:
score: 0
Accepted
time: 60ms
memory: 12888kb
input:
600
output:
Yes 1051796 925794 50193 526920 263184 231598 21520 1024195 4880 1089701 725840 1056811 384452 664081 1360966 141736 1114707 302468 1073235 624776 1181025 94350 1313345 225320 789907 237612 526864 29831 524352 22843 755396 266273 140160 873476 133201 816266 1081425 343584 49560 333859 181060 332962 ...
result:
ok 1
Test #18:
score: 0
Accepted
time: 84ms
memory: 15784kb
input:
700
output:
Yes 491796 1593954 175377 331976 183824 790958 229904 1337731 131088 42725 332048 1583787 295236 209553 262214 775592 270355 248900 1057043 432648 1057889 414350 1647681 315432 665107 1100268 536592 347975 1609728 461755 1105988 5665 622720 416324 74001 1201866 362513 1204576 302232 590435 1342596 7...
result:
ok 1
Test #19:
score: 0
Accepted
time: 113ms
memory: 19220kb
input:
800
output:
Yes 1851796 244322 1064977 328520 562192 1051566 126992 135107 1048592 933797 1065040 988459 2756 2109713 721478 2123944 1250131 2376836 631123 412296 1119329 18830 1552961 2098472 1038995 9260 185104 1638535 439872 1050683 829124 1071137 369536 1711108 336465 1579146 402001 38944 17304 2429987 6579...
result:
ok 1
Test #20:
score: 0
Accepted
time: 142ms
memory: 24420kb
input:
900
output:
Yes 1771796 2138786 1383505 2671496 276560 2279342 788496 1225027 2164240 436645 594512 2524459 29252 2067857 2109446 1967400 2128403 1115332 30995 262792 2097185 125774 1310721 193896 19 2400044 663568 1332615 164352 1594427 230340 2100257 144256 3165188 45073 215114 2658705 470624 1577112 346403 1...
result:
ok 1
Test #21:
score: 0
Accepted
time: 166ms
memory: 28268kb
input:
1000
output:
Yes 576367 2367616 105760 2891791 136896 540985 2536966 16600 2373120 1591560 406192 2165062 1197737 2469972 1706915 316440 207140 3424899 764236 283825 1714506 98868 672065 2138162 724744 1323155 753760 1067935 2462752 1188047 2938912 8901 1969170 32897 2908754 196612 549234 34948 2162707 568872 47...
result:
ok 1
Test #22:
score: 0
Accepted
time: 269ms
memory: 36868kb
input:
1200
output:
Yes 2176367 804992 2307616 5031951 3352000 787001 5417222 852184 3281152 50696 5056688 21574 3025321 5342292 2884515 1251352 9508 2379907 5417292 607409 5636682 2703412 1086273 2296882 1892616 4397715 3187040 4279455 1081632 2639567 4493600 2117317 32786 5202049 1054802 2285572 1579122 4219780 36763...
result:
ok 1
Test #23:
score: 0
Accepted
time: 382ms
memory: 44480kb
input:
1400
output:
Yes 5899629 2396816 589866 2522388 4817545 1449062 4194696 1806357 2978 3867733 299306 738821 5550178 2113693 1281376 2125974 1509481 2672258 1116236 4773266 1518125 6344704 1510508 4735635 234528 2098115 5697548 1155 3600752 4260875 948928 3212294 970816 1116714 4214804 1672041 2380928 5802032 4710...
result:
ok 1
Test #24:
score: 0
Accepted
time: 545ms
memory: 55376kb
input:
1600
output:
Yes 9377003 6351616 8913936 5689705 598676 135529 9741972 147819 2654720 28111 5505552 2242755 327988 697920 4541 8293376 86316 1445585 6328576 532623 510800 1062027 2492688 1578670 467264 7389885 8532032 2983967 8417632 4096518 4208736 934019 107536 3932586 8613456 4194730 8622656 1598644 395785 73...
result:
ok 1
Test #25:
score: 0
Accepted
time: 749ms
memory: 67276kb
input:
1800
output:
Yes 10671813 4270088 8409504 2557972 550856 1179651 9210076 3303171 8456444 3208961 8587286 528393 1566496 526492 4690946 9445796 4474907 10590180 411649 5289756 2949121 8563896 606788 11941258 639552 7737379 1220 3978003 8389736 4018817 360 8343556 8400002 7934565 16522 426804 10557635 5645604 2097...
result:
ok 1
Test #26:
score: 0
Accepted
time: 954ms
memory: 73412kb
input:
1900
output:
Yes 14061653 82856 6337557 9653160 6599680 9569220 4734011 1196096 6892841 8536576 1840626 2252808 13403639 3354632 8945799 3430008 98565 12998200 1116483 4613280 3707661 8873024 4718648 40256 7299763 8393036 4211715 2920472 12600708 2234424 4465986 557236 9728323 721032 13687860 2171848 13261874 35...
result:
ok 1
Test #27:
score: 0
Accepted
time: 963ms
memory: 74688kb
input:
1920
output:
Yes 11028803 4501672 1720592 2360032 4832517 3539018 4281904 1744963 4526080 8578536 1839623 12709144 1183776 10578889 820278 7409865 9086466 4198812 2679392 330762 5427328 592919 4616264 9502758 2361489 12599846 887873 8393006 271489 13685024 655450 4302881 2377602 1775713 8667392 4202175 10371328 ...
result:
ok 1
Test #28:
score: 0
Accepted
time: 987ms
memory: 80024kb
input:
2000
output:
Yes 5012185 3343362 4465065 3737110 4239624 2493666 8966420 2436707 8946072 4419585 1835066 14878468 264234 9118149 3447848 65623 4249768 3081025 9481246 6881409 8557392 5046413 3336818 5047553 3181290 992512 9490564 5049448 1187842 890784 6447107 8984676 7472778 8675617 1770510 6297777 9971534 4608...
result:
ok 1
Test #29:
score: 0
Accepted
time: 1ms
memory: 3816kb
input:
62
output:
Yes 11689 528 11266 925 4194 10117 4154 1477 8728 1413 2634 5376 2059 10020 6209 9604 6696 464 13825 322 10261 4778 8449 668 14370 1501 6656 9312 266 10784 4376 1090 10649 4130 9089 7190 648 6439 216 7719 408 1088 532 4226 2329 12480 1293 6688 8320 1834 2117 9624 516 7417 256 13976 321 1208 6470 32 ...
result:
ok 1
Test #30:
score: 0
Accepted
time: 3ms
memory: 4348kb
input:
130
output:
Yes 26169 32960 22818 41997 2738 12293 2314 8213 1640 20741 43130 4352 24827 4612 57425 804 13384 49680 1153 24930 33413 27706 32897 21564 43266 17101 15360 49408 3706 41088 1112 33026 9833 53634 11297 20822 1704 28679 1672 26743 904 52304 12704 33810 31625 96 51485 160 28480 4234 18981 32984 18724 ...
result:
ok 1
Test #31:
score: 0
Accepted
time: 3ms
memory: 4296kb
input:
126
output:
Yes 24841 4640 9666 51213 4578 49669 12426 51525 1576 6405 42522 6592 41019 17156 14465 33796 2216 8960 21521 9186 33813 10826 33969 17228 33826 19101 41312 7680 33018 3072 24968 7698 49161 15074 34065 14470 17448 583 59528 4103 10904 53536 9748 18882 521 41376 4173 49168 9920 35114 12309 19080 4637...
result:
ok 1
Test #32:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
66
output:
Yes 4105 2832 5122 10333 930 7189 330 4741 9576 6165 8714 80 6955 1092 14625 532 3368 12416 881 11394 4213 2442 625 11276 754 4365 10800 4096 554 15504 40 7314 585 5506 10817 1302 8936 7447 8296 2183 5656 8576 4 7810 345 13472 589 13456 2304 4650 2261 4392 196 5913 2112 8968 6193 17288 14390 960 210...
result:
ok 1
Test #33:
score: 0
Accepted
time: 182ms
memory: 27772kb
input:
1021
output:
Yes 1736529 2392236 1128978 132577 4001806 175265 803334 3325425 65548 309697 3227686 308176 3277835 329776 1052677 2696560 135692 1319328 728073 1049126 2219265 1442550 558081 149740 2962178 52425 2437652 1573056 2377006 1653312 147628 2995218 16769 491526 2639697 1310862 2277184 1130687 535104 110...
result:
ok 1
Test #34:
score: 0
Accepted
time: 200ms
memory: 28832kb
input:
1022
output:
Yes 3381145 2144 1757954 2433197 573442 1385653 2801674 1118181 167960 2648613 1315018 526384 336139 2624532 1532801 2132004 943256 1054976 262705 2676034 458933 2667850 1329809 2233420 1835666 116045 2109584 704864 262666 3235280 786472 1212242 557065 3362962 819265 2194198 1605736 2315143 1059848 ...
result:
ok 1
Test #35:
score: 0
Accepted
time: 191ms
memory: 27556kb
input:
1023
output:
Yes 1209788 2097152 1906269 8354 1610781 199328 262147 3221144 282982 101513 1835584 2331021 795200 3311888 292549 1212450 544925 3219744 661663 1393728 37528 394276 9177 1803296 271177 2148500 865131 1067024 300901 26754 135264 2163587 810008 1089633 726808 57509 138072 1065089 101130 1724640 29772...
result:
ok 1
Test #36:
score: 0
Accepted
time: 193ms
memory: 28972kb
input:
1024
output:
Yes 2259900 294912 3677933 49154 1514557 541504 297131 2318416 268686 607313 2363400 673333 2404680 737844 3152329 589846 3339113 525460 131875 4013272 180740 3421240 2629 3072176 1052685 2279952 1646663 2261424 1140237 528642 142952 1851411 69228 3035393 1172 1765953 262436 2236105 606226 2533216 1...
result:
ok 1
Test #37:
score: 0
Accepted
time: 191ms
memory: 27636kb
input:
1025
output:
Yes 2363917 615810 428568 2708801 1059390 2659584 1469134 623920 1049103 353440 3676703 344416 37388 3350867 1576 2994321 1180768 2379801 1738694 358417 3704332 272449 545466 238853 541266 2505132 640528 1444070 2160144 1048618 2449365 565280 479066 2662533 332080 180352 1841747 98308 1715403 381488...
result:
ok 1
Test #38:
score: 0
Accepted
time: 204ms
memory: 29724kb
input:
1026
output:
Yes 2909485 197266 3942660 103153 1075470 2983456 143814 1868800 2257127 1869312 86475 544 1499472 71843 4204096 3889541 8288 4161545 22322 1835209 2208816 262853 3863602 264325 3778378 264356 1632088 2359334 1115280 2912334 35601 3830952 264470 2654793 1514628 2671224 197891 1852020 2300171 583184 ...
result:
ok 1
Test #39:
score: 0
Accepted
time: 191ms
memory: 27740kb
input:
1027
output:
Yes 3905062 278592 731942 1052696 2279297 860216 2130625 134156 3940962 69637 3672778 311568 197161 1066452 864769 166286 3683409 443302 1114193 3074604 5328 4098059 88036 3285001 122512 532844 1531409 2629728 155275 3678564 384649 1187890 2170048 1884437 2301152 8454 3328537 65734 1757712 73934 410...
result:
ok 1
Extra Test:
score: 0
Extra Test Passed