QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#256608 | #7629. Make SYSU Great Again II | ucup-team2580 | WA | 267ms | 29708kb | C++20 | 1.3kb | 2023-11-18 20:31:06 | 2023-11-18 20:31: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[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||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: 3528kb
input:
4
output:
Yes 12 34 5 26 0 4 16 1 48 2 37 8 10 20 0 23
result:
ok 1
Test #2:
score: 0
Accepted
time: 0ms
memory: 3480kb
input:
1
output:
Yes 0
result:
ok 1
Test #3:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
2
output:
Yes 12 2 1 8
result:
ok 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
3
output:
Yes 0 30 1 22 32 2 9 16 12
result:
ok 1
Test #5:
score: 0
Accepted
time: 0ms
memory: 3452kb
input:
5
output:
Yes 88 6 1 14 16 34 65 8 0 10 20 40 66 32 17 11 4 24 5 74 36 3 68 26 33
result:
ok 1
Test #6:
score: 0
Accepted
time: 1ms
memory: 3464kb
input:
8
output:
Yes 76 162 5 26 0 102 129 16 48 4 82 161 90 128 100 139 10 113 12 18 133 40 2 96 1 132 19 200 32 21 160 20 110 17 36 3 192 8 67 136 144 34 152 68 50 64 164 66 14 145 70 9 196 25 66 172 224 6 33 84 11 36 24 65
result:
ok 1
Test #7:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
13
output:
Yes 104 518 393 114 0 610 281 164 256 614 384 93 642 18 329 54 264 151 8 166 345 134 280 67 544 13 237 528 72 145 96 660 64 162 337 512 24 261 626 2 40 531 108 403 32 7 536 132 266 640 112 385 228 1 388 16 12 466 552 320 27 4 105 262 88 257 188 66 516 50 520 71 144 36 538 260 89 258 222 513 48...
result:
ok 1
Test #8:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
21
output:
Yes 1188 66 153 806 64 398 1057 512 128 874 1172 265 722 32 1625 418 1032 471 40 1222 281 603 1408 70 1041 932 1089 528 8 337 1024 96 1026 33 402 4 1544 193 0 1105 808 134 1152 31 1440 72 2 392 3 864 132 587 144 581 274 620 145 352 520 16 6 1168 608 850 160 17 166 280 576 1028 154 609 384 1570 25...
result:
ok 1
Test #9:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
34
output:
Yes 2524 546 3205 794 128 550 1297 2656 1296 2242 1056 2953 4146 3588 17 494 1536 459 3092 226 1549 2290 256 3834 1 3188 3 944 2120 1445 2122 1076 4426 2049 4131 1168 34 197 3898 65 6 4369 174 785 130 1104 516 73 3622 0 4181 512 42 513 242 780 1089 260 592 264 656 2126 528 10 133 2890 16 1962 3412...
result:
ok 1
Test #10:
score: 0
Accepted
time: 1ms
memory: 3768kb
input:
55
output:
Yes 1788 2306 601 11298 540 3138 5045 10240 2020 8218 32 12037 194 11268 4953 34 2448 4687 3200 30 7617 54 8832 3090 329 6196 1419 10868 5384 2133 138 2628 4154 3969 98 1156 10314 1333 2626 5137 2538 17 3078 8553 6290 1029 10674 13 2754 8504 2625 1418 68 2345 4610 2304 197 1024 661 4160 45 10306 52...
result:
ok 1
Test #11:
score: 0
Accepted
time: 0ms
memory: 4080kb
input:
89
output:
Yes 1684 18434 13845 2 10136 102 7177 8592 18504 12934 16728 12833 16654 16048 265 29430 3080 771 29872 2058 14049 18688 13906 18444 531 6624 9243 2400 22032 201 5638 8216 3970 16441 11782 4504 25090 2141 12962 19781 12842 18449 8326 3961 130 25669 4106 11045 20562 1184 4933 3250 16708 6817 17742 10...
result:
ok 1
Test #12:
score: 0
Accepted
time: 2ms
memory: 4108kb
input:
100
output:
Yes 588 27810 4357 33946 20992 358 18945 1360 22560 1298 10752 1065 10834 20868 8225 7710 32928 6491 16900 15378 17037 8514 17536 33370 1 1524 33283 26704 296 3093 17162 13396 19114 5137 24934 6160 770 7205 138 19249 1030 20657 1806 16401 386 38401 26982 137 25350 3304 33285 5130 4 18713 1666 12332 ...
result:
ok 1
Test #13:
score: 0
Accepted
time: 6ms
memory: 6232kb
input:
200
output:
Yes 588 67746 4357 110106 256 102 99201 23568 352 101522 17216 112809 16978 46468 131169 127646 2336 119387 142596 86162 36429 143490 2624 151834 99841 22708 132867 14352 50600 2069 136138 93204 37738 139409 6694 42128 88898 40997 6282 59249 2054 20657 1806 55377 67074 36865 66982 25097 104838 13213...
result:
ok 1
Test #14:
score: 0
Accepted
time: 9ms
memory: 6492kb
input:
300
output:
Yes 240588 17442 45381 149146 4096 36262 143425 98448 143904 50194 332032 165417 96530 33988 219425 34334 276512 231195 24708 295250 24205 262466 225920 2330 78529 51252 144195 346128 168552 27669 136138 289812 132010 52241 209574 1296 241794 262437 24138 41265 203334 16561 165902 86097 139906 26956...
result:
ok 1
Test #15:
score: 0
Accepted
time: 21ms
memory: 8208kb
input:
400
output:
Yes 320588 203170 5 274202 147456 332902 33665 601104 267104 158866 528960 289193 234066 25988 266337 181406 596000 279387 40964 214418 536653 296834 591936 152346 600065 53940 264195 42512 200872 286741 36042 90900 431210 590737 305190 198032 537154 363813 131210 59249 329734 180657 5646 51537 2636...
result:
ok 1
Test #16:
score: 0
Accepted
time: 33ms
memory: 11876kb
input:
500
output:
Yes 360588 5666 606405 408602 114688 278438 688129 30800 99744 948754 384 929385 32914 790020 147617 276510 704736 11803 213380 4178 732941 53378 9472 985178 50689 407732 623107 142416 590248 417813 531466 49876 14378 771281 264998 205968 22530 271589 725258 3825 160006 36081 930062 117905 4674 4783...
result:
ok 1
Test #17:
score: 0
Accepted
time: 60ms
memory: 12976kb
input:
600
output:
Yes 960588 82594 1060869 901914 134144 1118310 829569 67344 438368 606866 167232 1118377 158034 38020 607073 1181854 274976 591195 417796 1088658 16973 625026 419392 6426 434177 88756 1188867 377104 530600 157205 6602 1369620 133226 1132433 927782 66960 537154 150821 626826 26481 202758 16561 165902...
result:
ok 1
Test #18:
score: 0
Accepted
time: 73ms
memory: 16608kb
input:
700
output:
Yes 520588 1574434 113029 786970 118976 1059878 578241 1117200 557344 1057490 491520 9321 770834 1054788 288161 70174 797024 1233051 861764 1104018 787981 59714 329344 51226 577 641460 271939 1216912 330344 655765 298058 672020 1095850 460049 1083558 131408 271490 639781 11338 819249 1130822 540337 ...
result:
ok 1
Test #19:
score: 0
Accepted
time: 98ms
memory: 19104kb
input:
800
output:
Yes 1600588 201122 1860613 103194 1056768 2392166 1117057 832528 197472 1635474 2427456 46505 2165330 62852 919649 1085598 155680 263003 1583108 360850 1078349 527234 2543680 528154 73729 695988 262147 1586704 313512 204821 298186 1078036 427114 2116497 111654 805264 1094210 331045 1183882 59249 329...
result:
ok 1
Test #20:
score: 0
Accepted
time: 139ms
memory: 22796kb
input:
900
output:
Yes 698774 69697 1057834 2916672 96444 1606976 290860 166417 1381608 581632 2559847 12296 2934855 1188480 2627849 1344130 2252853 1053512 2869379 272212 133161 649106 262212 107522 268444 558594 1458445 80002 2787084 1048688 426368 2637361 278656 1744190 2162881 1486390 2118017 265848 127110 2754057...
result:
ok 1
Test #21:
score: 0
Accepted
time: 161ms
memory: 27832kb
input:
1000
output:
Yes 58774 135745 2133162 393792 2118076 689216 3213996 282705 3901608 12608 1164839 2767048 1147143 2363520 1288201 2901570 168245 271880 1198339 853588 2253225 1381394 2787844 1066114 2702172 1360002 2103117 124930 1835532 46256 1313024 2819633 1335552 656126 277505 754294 3435521 623224 139270 193...
result:
ok 1
Test #22:
score: -100
Wrong Answer
time: 267ms
memory: 29708kb
input:
1200
output:
Yes 5657060 2662409 203600 4457484 2177760 1049630 274753 1753232 71969 2400396 739139 3418164 644097 4597762 66224 2146308 5250811 393472 1661558 426248 3694279 4522296 1727687 2171144 5296727 76968 4739153 1149218 398028 1657889 2523850 526384 4534656 52324 2884235 5317684 579842 263744 3330307 68...
result:
wrong answer There exist two adjacent numbers whose bitwise AND value is greater than 0.