QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#226827 | #7629. Make SYSU Great Again II | comeintocalm# | TL | 1764ms | 66280kb | C++20 | 902b | 2023-10-26 16:52:53 | 2023-10-26 16:52:54 |
Judging History
answer
#include <cstdio>
#include <algorithm>
using namespace std;
const int MAXN = 2105, TEST = 14;
int MX;
int RD()
{
return ((rand()%(65535)) ^ ((rand()%(65535)) << 14)) % MX;
}
int n;
int a[MAXN][MAXN];
int cnt[MAXN*MAXN*4];
int isfail;
int main()
{
scanf("%d", &n);
MX = 4*n*n;
isfail = 0;
for (int i = 1;i <= n; i++) {
for (int j = 1;j <= n; j++) {
int via = ~(a[i-1][j] | a[i][j-1]);
int MI = RD() & via;
for (int cas = 1; cas <= TEST; cas++) {
int x = RD() & via;
if (cnt[MI] > cnt[x]) {
MI = x;
}
}
if (cnt[MI] > 5) {
isfail = 1;
break;
}
cnt[MI]++;
a[i][j] = MI;
}
if (isfail == 1) {
break;
}
}
if (isfail == 1) {
printf("No\n");
} else {
printf("Yes\n");
for (int i = 1;i <= n; i++) {
for (int j = 1;j <= n; j++) {
printf("%d%c", a[i][j], j==n?'\n':' ');
}
}
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 1520kb
input:
4
output:
Yes 50 1 32 10 12 2 29 0 35 4 34 17 8 48 13 34
result:
ok 1
Test #2:
score: 0
Accepted
time: 0ms
memory: 1608kb
input:
1
output:
Yes 2
result:
ok 1
Test #3:
score: 0
Accepted
time: 0ms
memory: 1520kb
input:
2
output:
Yes 2 1 8 6
result:
ok 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 1612kb
input:
3
output:
Yes 26 5 16 0 8 34 3 4 9
result:
ok 1
Test #5:
score: 0
Accepted
time: 0ms
memory: 1612kb
input:
5
output:
Yes 2 77 16 66 36 64 32 69 40 82 27 0 18 4 33 96 17 44 19 12 10 68 1 72 50
result:
ok 1
Test #6:
score: 0
Accepted
time: 0ms
memory: 1604kb
input:
8
output:
Yes 242 1 160 10 212 42 21 96 12 226 29 224 8 208 40 147 128 4 32 9 178 13 0 64 6 145 74 48 76 16 172 17 97 14 129 66 177 68 2 200 26 65 52 136 70 169 20 35 132 58 192 3 56 4 232 0 107 128 24 36 67 176 5 218
result:
ok 1
Test #7:
score: 0
Accepted
time: 0ms
memory: 1564kb
input:
13
output:
Yes 190 513 184 258 176 522 225 16 608 26 449 24 516 0 48 323 152 70 160 540 34 9 324 42 452 3 39 72 52 1 648 85 32 468 514 128 593 8 484 64 183 512 12 19 416 25 2 84 555 388 515 24 158 256 65 400 96 31 352 528 43 80 35 92 419 257 568 130 100 144 288 148 330 644 296 208 546 4 18 133 368 520 36 27 32...
result:
ok 1
Test #8:
score: 0
Accepted
time: 0ms
memory: 1592kb
input:
21
output:
Yes 1070 193 820 66 952 6 1513 0 1164 338 513 1496 32 898 65 424 1092 162 1292 1 782 657 1056 9 1284 67 1416 18 940 17 1700 320 5 1746 37 922 1093 936 64 176 1290 81 1032 147 576 169 1044 3 1196 2 352 11 1664 376 4 1610 36 776 1104 772 1024 208 1582 194 516 1043 324 650 1120 528 77 16 740 264 128 10...
result:
ok 1
Test #9:
score: 0
Accepted
time: 1ms
memory: 1664kb
input:
34
output:
Yes 1650 2049 224 3098 228 1546 2501 544 3356 2 693 3080 4224 1326 129 3866 4 906 2048 4185 802 3101 96 528 3302 17 416 1627 292 1609 4500 9 2816 190 4229 546 2069 736 2058 384 1562 1 130 2613 1354 549 1288 640 4398 0 2099 1024 350 1568 2197 800 1035 4384 536 3424 26 4516 2651 32 1027 2240 4156 2560...
result:
ok 1
Test #10:
score: 0
Accepted
time: 1ms
memory: 1772kb
input:
55
output:
Yes 6202 769 3084 8322 1136 4750 10561 536 3300 530 1261 512 5228 10626 5733 2050 568 9478 4704 9605 586 2325 8832 1296 6214 8881 1036 8979 160 1101 912 3105 344 6146 1577 8534 2729 1104 10406 1032 4519 1088 6177 1562 8548 649 10356 4482 1568 2262 1833 2134 128 9309 6816 9217 158 801 92 4610 368 648...
result:
ok 1
Test #11:
score: 0
Accepted
time: 2ms
memory: 2088kb
input:
89
output:
Yes 20806 1681 10348 21522 2272 8982 23721 68 23336 9298 7081 17412 8752 17610 6965 17538 4688 19850 4676 3505 582 2321 1632 27028 1130 8469 20616 2819 16392 6037 24672 661 1088 23454 33 5278 8705 20924 8706 5288 2899 25736 309 21634 2592 5209 2976 29774 768 1214 10305 686 21840 10917 4168 28566 105...
result:
ok 1
Test #12:
score: 0
Accepted
time: 3ms
memory: 2156kb
input:
100
output:
Yes 20402 1 15584 17162 1044 10346 20629 36384 268 8226 19797 12456 2304 33854 12865 17850 12356 17546 12336 16905 4338 16397 4112 10688 5126 19409 5120 35579 24580 2265 4644 281 2592 17422 9089 35938 28693 35080 22018 2184 611 17536 12341 3522 8 38565 2056 12434 19532 8834 38965 1410 12364 2305 174...
result:
ok 1
Test #13:
score: 0
Accepted
time: 8ms
memory: 3144kb
input:
200
output:
Yes 60402 131073 4512 57866 137428 124202 4117 76384 49548 78946 18709 13544 33024 153854 75265 506 133124 57546 5168 139977 1330 139277 1232 10496 83462 139409 37376 76091 54852 281 86692 2329 42592 137358 25345 99426 149653 75080 23042 41160 87843 10304 131253 55810 1096 37541 82952 14482 65548 11...
result:
ok 1
Test #14:
score: 0
Accepted
time: 28ms
memory: 4508kb
input:
300
output:
Yes 20402 335873 181856 77962 49236 10282 180629 72288 286988 66082 42453 84008 264000 233534 2817 225530 516 57546 268592 254601 7282 295437 140496 281344 242694 262609 165376 82299 8708 122265 8804 196633 42848 135182 305473 83618 172309 23048 139714 99336 611 258048 263733 174274 70664 158565 299...
result:
ok 1
Test #15:
score: 0
Accepted
time: 43ms
memory: 6320kb
input:
400
output:
Yes 220402 262657 192928 522 616916 431658 589845 396384 115084 13410 182805 9704 514048 8958 573697 5370 608260 41162 5168 616905 393266 38413 458960 10496 83462 139409 37376 396603 544836 2073 86692 2329 520800 3214 184321 591970 37781 550984 496130 18888 598563 23872 434869 84226 304712 88229 401...
result:
ok 1
Test #16:
score: 0
Accepted
time: 71ms
memory: 8336kb
input:
500
output:
Yes 820402 84289 13344 165962 864660 1578 229845 6688 230476 29090 331349 549288 101376 160062 557249 461626 537732 213258 2288 618761 36402 459021 63632 788032 41222 147665 634624 393275 82948 47513 606308 400537 614432 131726 905473 3298 868629 147144 573442 198920 800355 147712 2293 413698 107400...
result:
ok 1
Test #17:
score: 0
Accepted
time: 131ms
memory: 11000kb
input:
600
output:
Yes 380402 1056769 607392 1321738 775380 1057578 902165 138080 1074316 334178 565781 281064 721408 298494 1179649 94970 920580 57546 596016 25033 596530 295949 139472 642304 143878 1412241 524544 1196603 368708 547353 402596 563737 9568 1249422 534273 1067106 202645 550984 496130 1076680 4131 254016...
result:
ok 1
Test #18:
score: 0
Accepted
time: 172ms
memory: 15348kb
input:
700
output:
Yes 1180402 88065 9440 1858058 172244 609322 1442261 562720 1395084 660514 335893 1725352 68672 1368254 134401 262714 30852 655370 1169072 272457 1299122 11277 938448 1093120 397318 9361 197376 835835 9988 1689689 132004 1924121 928 1697806 4737 871458 1061461 346504 1225794 804872 1257891 2560 9131...
result:
ok 1
Test #19:
score: 0
Accepted
time: 240ms
memory: 18316kb
input:
800
output:
Yes 860402 1099265 405920 558602 1339860 656938 65557 396384 622988 29794 819733 1191400 102400 1721086 2362625 1822970 2369540 689354 1128496 2541001 4146 936461 2101456 10496 2003462 76945 1888768 134459 1052740 526361 86692 2329 1802848 294030 1179649 596066 1197973 786504 242178 18888 598563 149...
result:
ok 1
Test #20:
score: 0
Accepted
time: 337ms
memory: 23176kb
input:
900
output:
Yes 2180402 696385 1327392 241866 1067796 8298 3070869 65568 1075084 694306 2098005 155816 3146048 953534 769 945274 1151108 19210 3154160 644105 1450930 2131981 923344 3170560 597062 1188497 2676992 459963 1103940 861337 168548 2688025 400160 533582 131969 1435682 2625749 93448 1213058 786696 22584...
result:
ok 1
Test #21:
score: 0
Accepted
time: 394ms
memory: 25036kb
input:
1000
output:
Yes 1820402 2361345 1095584 83978 1881044 2231338 1097749 203616 1097868 79202 281109 532968 1117696 2142718 540673 1445370 537092 3212746 18992 602569 1458738 66829 1194704 803840 41222 3147409 667904 265275 1081924 2097177 1509540 2679577 1252448 557198 2381057 1769570 2148757 328776 2255618 16396...
result:
ok 1
Test #22:
score: 0
Accepted
time: 632ms
memory: 34496kb
input:
1200
output:
Yes 4700402 513 4935072 1319434 4834772 1057322 2742293 1049696 2906508 1123426 819733 27112 2425856 33534 1180929 2973946 1183748 57546 596016 25033 4916274 299533 2753744 125184 4456966 1158289 807424 5254459 774212 3157017 131748 1873177 4325984 1383566 2105345 410722 1121173 548936 496130 369504...
result:
ok 1
Test #23:
score: 0
Accepted
time: 940ms
memory: 43024kb
input:
1400
output:
Yes 1180402 2959617 5297312 2491146 63700 6489386 1372693 4851808 1393036 2622562 329749 3691496 68608 1368318 6292737 1950458 14340 2605258 5252912 362697 6820658 1256461 807376 7349760 397318 9361 197376 2665531 4214852 3376153 17316 5843993 184416 3473550 31233 2819170 5524117 2818120 5287170 540...
result:
ok 1
Test #24:
score: 0
Accepted
time: 1275ms
memory: 54776kb
input:
1600
output:
Yes 3420402 50689 5575072 574986 4456916 9147946 21 5516384 2265484 5244002 2339349 1314280 8577024 4264702 3419393 8454394 2533380 1119434 174128 2377161 4923442 285197 10059984 2504960 4751878 8543377 1942016 134459 6303812 526361 4682404 3148057 4825696 1318030 2711553 5638242 87957 6955080 14300...
result:
ok 1
Test #25:
score: 0
Accepted
time: 1764ms
memory: 66280kb
input:
1800
output:
Yes 11900402 663553 7684512 8912906 2468820 9457706 109589 10240608 9612 11487330 37653 2253032 9502976 953598 9458433 6360314 8913156 4377290 2167856 4874441 1381170 2131981 923344 6406400 10227206 2322833 8948224 6431803 1153348 5137433 10486692 816153 5278560 2823310 8961 11147362 82069 9178696 7...
result:
ok 1
Test #26:
score: -100
Time Limit Exceeded
input:
1900
output:
Yes 820402 5335041 8914848 7456842 4628 8645738 3670037 4210656 999436 12592098 3150869 412520 14159872 198078 3947073 116026 14291588 273674 2102000 13860873 31858 5407245 8920336 4440256 2883590 5456145 538240 6471803 9247876 1097753 13110308 176665 609568 10490446 5672193 11104994 4228117 1143405...