QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#226828 | #7629. Make SYSU Great Again II | comeintocalm# | AC ✓ | 1098ms | 78540kb | C++20 | 942b | 2023-10-26 16:54:56 | 2023-10-26 16:54:57 |
Judging History
answer
#include <cstdio>
#include <algorithm>
#include <time.h>
using namespace std;
const int MAXN = 2105, TEST = 10;
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()
{
srand(time(NULL));
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':' ');
}
}
}
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 1696kb
input:
4
output:
Yes 10 37 8 17 1 0 32 2 18 13 16 9 36 18 44 16
result:
ok 1
Test #2:
score: 0
Accepted
time: 0ms
memory: 1616kb
input:
1
output:
Yes 2
result:
ok 1
Test #3:
score: 0
Accepted
time: 0ms
memory: 1720kb
input:
2
output:
Yes 10 5 0 2
result:
ok 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 1680kb
input:
3
output:
Yes 14 1 16 17 2 4 12 33 0
result:
ok 1
Test #5:
score: 0
Accepted
time: 0ms
memory: 1692kb
input:
5
output:
Yes 90 1 64 5 82 4 72 35 24 37 34 20 0 3 80 29 66 41 84 10 2 25 6 33 68
result:
ok 1
Test #6:
score: 0
Accepted
time: 0ms
memory: 1684kb
input:
8
output:
Yes 138 37 136 81 130 1 40 131 16 72 54 8 69 58 196 24 75 180 9 114 128 68 25 98 164 73 50 5 80 10 224 13 2 144 76 178 12 48 11 96 208 0 32 77 146 64 52 139 47 0 207 16 108 147 8 36 80 39 0 38 129 44 67 152
result:
ok 1
Test #7:
score: 0
Accepted
time: 0ms
memory: 1760kb
input:
13
output:
Yes 10 53 456 37 26 385 76 515 372 11 36 65 566 565 2 529 258 197 520 386 40 3 132 603 384 9 130 541 32 88 0 371 8 321 140 531 292 18 512 629 256 596 162 601 4 528 34 17 64 657 108 274 264 194 41 68 416 91 160 521 128 1 302 144 517 149 288 576 427 516 256 70 432 75 176 513 328 16 544 73 402 68 51 19...
result:
ok 1
Test #8:
score: 0
Accepted
time: 0ms
memory: 1700kb
input:
21
output:
Yes 878 1153 844 177 266 69 152 323 544 1429 98 785 1218 297 82 269 66 1577 404 586 401 17 268 19 836 145 1026 357 528 450 32 901 1098 769 194 1321 208 1288 84 9 1424 104 898 33 972 0 1640 256 1560 261 16 1418 48 768 1168 5 210 773 144 1056 772 65 918 1060 26 1 34 405 512 35 64 1167 560 1031 224 259...
result:
ok 1
Test #9:
score: 0
Accepted
time: 0ms
memory: 1800kb
input:
34
output:
Yes 4570 5 888 3201 562 3137 808 3075 176 583 3512 4161 1566 257 4334 3089 746 3345 520 2354 69 146 1549 2402 4253 2 2969 6 1969 2126 688 15 2240 4361 1028 66 1025 4222 2176 4140 2242 268 2562 264 512 3088 352 144 3841 76 3072 130 20 1736 256 1029 82 516 354 1664 4 0 74 4496 1102 2592 1297 2050 435 ...
result:
ok 1
Test #10:
score: 0
Accepted
time: 1ms
memory: 1948kb
input:
55
output:
Yes 11290 129 9064 2053 5986 2177 544 2503 528 3427 8208 8009 38 2825 9318 2705 1382 2585 8224 3094 289 10434 17 5070 3105 4122 8801 7318 321 5134 2800 8451 2632 5265 778 1137 8588 7698 8264 3601 4138 1600 2454 4201 3732 4128 11608 512 3181 8592 1544 2466 1564 322 561 513 4178 3076 4154 2176 5976 13...
result:
ok 1
Test #11:
score: 0
Accepted
time: 2ms
memory: 2180kb
input:
89
output:
Yes 18598 12297 1264 28681 1522 521 15696 647 13624 67 13728 2141 17058 15373 114 27789 4882 24773 7960 8290 20505 3074 20549 8578 5205 11138 17481 14998 257 12006 20752 1027 18684 1793 12338 3521 4612 26850 1813 18464 1238 24872 6166 17609 12308 3648 24588 4944 18605 13056 3148 690 2304 8386 17209 ...
result:
ok 1
Test #12:
score: 0
Accepted
time: 2ms
memory: 2256kb
input:
100
output:
Yes 17290 15397 264 5649 10562 4097 4072 4099 36560 24615 2904 12417 35598 13553 33550 17553 12618 20113 12360 19122 325 30210 93 24354 8269 2082 13145 19462 913 31822 32 33167 24672 2329 18150 10497 728 38950 17864 6181 10066 22540 194 2621 9472 6256 8960 21696 10509 21568 33424 5378 8300 2434 3280...
result:
ok 1
Test #13:
score: 0
Accepted
time: 6ms
memory: 3160kb
input:
200
output:
Yes 17290 15397 82312 43601 83330 45057 3112 82563 139536 105639 9048 133121 75598 20529 102350 24593 101962 17 69768 33650 25733 101122 21725 43810 70861 10274 135193 28166 33233 79374 18656 33039 144928 49561 65638 51201 77976 150822 4296 98597 28370 69900 16578 2621 49472 135728 126400 0 151181 2...
result:
ok 1
Test #14:
score: 0
Accepted
time: 15ms
memory: 4592kb
input:
300
output:
Yes 57290 262181 47432 279697 211458 32833 84008 165635 71696 25639 2904 332929 9038 135345 74510 183313 12746 19985 69768 59186 264197 230466 4381 264354 144397 82146 269593 148166 99345 286798 71200 188559 5664 133145 296358 90177 169112 354918 5512 98405 141330 20940 35842 82749 131264 44592 2828...
result:
ok 1
Test #15:
score: 0
Accepted
time: 35ms
memory: 7768kb
input:
400
output:
Yes 337290 184357 66952 284753 132994 73729 450344 65667 570896 18855 472664 542977 393294 124977 525006 12561 101962 417809 98696 546418 41349 590338 183773 73762 40909 8226 295193 155142 532689 67854 571104 344335 42528 217241 32870 18433 110744 150822 340680 147749 557778 27660 194 322621 66368 5...
result:
ok 1
Test #16:
score: 0
Accepted
time: 56ms
memory: 9996kb
input:
500
output:
Yes 408026 49153 786452 22184 886867 160384 885876 155912 822897 262 45057 917570 52488 860176 181699 342544 689421 4304 754696 12791 67592 566133 69768 394067 98304 679313 33346 986429 49216 926768 65730 809484 98385 413062 528481 322818 649 291876 655553 381992 655766 308233 147636 868096 16571 33...
result:
ok 1
Test #17:
score: 0
Accepted
time: 81ms
memory: 11016kb
input:
600
output:
Yes 928026 38465 270484 564328 82707 790720 164148 806984 1052081 172038 1121473 303618 1053000 781456 1315139 66064 938125 44304 1000008 1058103 350920 664885 1151496 796691 1132352 14353 165762 73853 21376 622640 1066626 432140 74769 678598 65825 402626 613129 401444 1097793 732968 4182 279561 230...
result:
ok 1
Test #18:
score: 0
Accepted
time: 116ms
memory: 13944kb
input:
700
output:
Yes 408026 573953 202836 803624 65555 447616 1647220 23944 295537 31110 786497 1074178 332616 1191056 639747 1454096 100301 786448 234824 534583 1069896 262325 31496 884883 142400 1904785 61186 983229 1071616 140592 120834 1704012 381201 1712326 6945 516226 1573641 291876 625217 156968 852566 107136...
result:
ok 1
Test #19:
score: 0
Accepted
time: 153ms
memory: 17200kb
input:
800
output:
Yes 2528026 1648705 2130068 404328 1627155 338880 1217588 2888 671921 72198 573633 398338 1114696 52368 1323331 2328592 550541 1315088 772680 1314871 2173896 1623093 15112 1459219 66368 2359313 1771906 295549 533632 1430320 534658 447500 75793 1316550 24609 1514690 16905 931876 66625 2382120 1179734...
result:
ok 1
Test #20:
score: 0
Accepted
time: 181ms
memory: 20940kb
input:
900
output:
Yes 2368026 593921 3155604 202792 1360851 592896 2519796 623880 1051377 2303238 561345 1321474 132488 2220048 1315139 2812432 69709 2515088 625224 287927 1774408 43061 71496 829459 1132352 407697 2687810 299197 82752 1359024 147970 2952652 176657 2703430 36129 2166786 945929 69796 451393 4264 223803...
result:
ok 1
Test #21:
score: 0
Accepted
time: 245ms
memory: 24988kb
input:
1000
output:
Yes 350996 9216 2480253 9728 2494869 1174632 2494978 1059841 409744 1120611 681612 3184962 484872 3184789 82466 3545168 17061 1423440 673165 2471936 149188 1642497 304546 1575005 2130082 1384776 2234034 1163336 136983 788640 3405067 262740 148872 3252261 138752 1343602 2302853 19480 3543079 27968 35...
result:
ok 1
Test #22:
score: 0
Accepted
time: 363ms
memory: 35592kb
input:
1200
output:
Yes 3710996 68608 5140861 2560 1695893 2102376 1934082 2114561 1443984 2154851 1839756 51522 2102280 189333 6178 1205072 99493 2638416 5673101 93696 1348036 2164225 5423522 800349 3246498 160328 5506482 131656 3519511 4344736 274443 5390420 789384 1188901 4987136 2172018 5525893 2173464 1462311 2138...
result:
ok 1
Test #23:
score: 0
Accepted
time: 496ms
memory: 44004kb
input:
1400
output:
Yes 738086 7382105 870692 4206595 608200 3420208 4292617 1867696 7 743568 6563587 1247332 540929 2368728 578055 5580992 49709 7802880 36107 139440 1955854 4326928 1372484 6424626 603649 1181856 62214 2952209 4359050 1142833 6426560 53268 6359232 582975 640 7043415 34336 6252698 4420 6956715 315460 3...
result:
ok 1
Test #24:
score: 0
Accepted
time: 652ms
memory: 55036kb
input:
1600
output:
Yes 4939810 1052692 4309152 2231114 1094801 4672324 532649 9458432 5088379 2103296 10166933 4229218 2181004 4765745 2098630 9058840 17509 7084552 198099 61448 7473783 832640 7473665 9032988 1049123 6594648 1660322 8432221 8339872 47701 5916040 277092 623003 8787520 624679 156672 6822883 1155096 7225...
result:
ok 1
Test #25:
score: 0
Accepted
time: 858ms
memory: 67928kb
input:
1800
output:
Yes 11069160 1185793 107724 5656611 75912 10801185 656280 7370791 755016 11810819 4293428 11534336 4946760 10748951 4346760 3418133 4293184 3951928 4403907 2392324 1588298 6603280 1126880 2524676 1647050 12896308 3286465 377364 9440267 2536244 8390667 3764704 396315 4259876 3326987 12916852 2229120 ...
result:
ok 1
Test #26:
score: 0
Accepted
time: 1002ms
memory: 72224kb
input:
1900
output:
Yes 3082655 8417312 1608468 8794186 4279956 11309320 5399733 11010634 5436421 8980880 1077263 10850096 1077379 7275120 9476353 2180746 10256640 162425 13960576 569926 12651552 4124939 4197620 3334401 263270 5443600 2943567 1114256 4867439 3408000 184137 4522118 557432 4348547 9175096 7404740 66051 2...
result:
ok 1
Test #27:
score: 0
Accepted
time: 1012ms
memory: 74952kb
input:
1920
output:
Yes 504295 9964032 6492233 1623942 2371688 623620 12984721 2114158 13704593 705132 73107 7996012 8745360 1214539 9245344 7531785 262150 13887088 2627597 393778 7347393 8847618 62061 7538962 304868 82177 2538648 8994848 2373779 10207244 276179 1786124 4201697 156190 8919296 1253959 8689840 3802882 62...
result:
ok 1
Test #28:
score: 0
Accepted
time: 1098ms
memory: 78540kb
input:
2000
output:
Yes 1328126 8522752 4800784 1191087 14979392 1198779 4272384 10635464 6099718 2121737 9147522 1321564 4800675 1314828 11087376 426120 7687 3678392 4627778 10559669 5113098 94321 4885644 356866 1212560 2432577 32798 10882241 5353736 17991 15310888 264593 8085578 5140 6971626 8490241 3809982 363520 58...
result:
ok 1
Test #29:
score: 0
Accepted
time: 1ms
memory: 1988kb
input:
62
output:
Yes 9992 150 15169 1196 4929 2056 9959 2328 9765 2376 13442 2656 8340 6153 9026 3201 12358 1288 13014 2344 4292 3098 4609 8690 3596 8576 6775 8328 803 11480 4869 2266 8996 1026 5081 2050 4952 2 13332 738 14613 1154 832 2083 9240 6725 9352 4960 2196 1313 2066 8520 5681 2188 4352 2595 5452 2690 9269 9...
result:
ok 1
Test #30:
score: 0
Accepted
time: 0ms
memory: 2548kb
input:
130
output:
Yes 47496 1558 59649 5164 11201 17464 12487 50472 12293 66120 47394 17984 14356 33961 6402 1601 51238 8920 36902 4040 40996 1306 29345 1282 60092 4160 61351 24 44259 21272 9445 20746 10980 1026 57961 7426 16536 66082 34068 6146 42501 4354 17424 9123 33800 28805 3400 53424 1284 8353 23314 104 13569 6...
result:
ok 1
Test #31:
score: 0
Accepted
time: 0ms
memory: 2476kb
input:
126
output:
Yes 8744 40134 16657 11852 145 15720 17031 2312 54901 2048 34418 2432 26228 2441 34 3009 21558 41544 19862 552 22676 106 14865 34178 572 24768 7687 33016 25859 4232 34053 20698 40996 402 15881 16610 47128 1314 51844 5394 35397 18 40448 355 14472 50741 12616 20016 33092 25265 1090 47880 17505 4620 51...
result:
ok 1
Test #32:
score: 0
Accepted
time: 1ms
memory: 2028kb
input:
66
output:
Yes 13784 2598 12737 16412 13985 72 4519 1112 933 10248 4898 11456 4100 17049 5122 11249 1030 8632 3590 4280 3844 202 2577 12450 2588 1504 8727 16552 339 6824 9541 4762 1028 8994 201 16130 248 4098 1508 10754 5461 642 16416 16339 8 16725 648 80 11908 4465 11266 328 2065 4940 128 9811 2348 5650 10565...
result:
ok 1
Test #33:
score: 0
Accepted
time: 240ms
memory: 25856kb
input:
1021
output:
Yes 2156340 458826 65057 3276928 567877 3227936 393303 3779240 21765 2294328 309254 1786232 2405888 737789 1026 1086393 199750 2130592 745566 2364288 1263656 2109634 2000953 838 2833536 1343508 20387 2338824 1312295 600208 2146373 1776930 49688 1974694 2185753 1451106 84236 3454626 672088 366754 328...
result:
ok 1
Test #34:
score: 0
Accepted
time: 249ms
memory: 25880kb
input:
1022
output:
Yes 523161 2622530 395913 1077312 98322 2888801 1084060 262465 1625766 274688 1770655 297248 226369 1870620 70658 1483652 540787 2364172 584803 2101252 845168 133129 2433202 708680 2164133 182354 4003745 190552 3670148 77369 442816 3215886 131073 2425602 1605720 200577 2367614 1282304 806468 3178544...
result:
ok 1
Test #35:
score: 0
Accepted
time: 245ms
memory: 25880kb
input:
1023
output:
Yes 3146897 750182 3178881 801832 3310274 882957 34000 196653 1601730 426012 94371 787224 62497 1509788 529442 1255700 541315 2143344 852619 145412 1672360 18437 1680818 2513472 565285 2495698 1624361 131712 1854516 132033 2747392 136050 330753 1106382 724496 291205 1179738 2897056 229696 2903712 98...
result:
ok 1
Test #36:
score: 0
Accepted
time: 264ms
memory: 26132kb
input:
1024
output:
Yes 3129002 1065025 2375426 1147097 921604 2195937 542742 33473 336942 2638288 1324557 2705536 402043 2638084 232010 2884641 1101966 724272 315457 2763824 377801 1058836 69954 4099248 25421 792736 3195994 275073 589832 445955 1642968 33831 2368328 1809558 270440 2821639 274560 1704057 379268 2102273...
result:
ok 1
Test #37:
score: 0
Accepted
time: 252ms
memory: 26604kb
input:
1025
output:
Yes 1252118 2654273 335382 49193 1511316 2637897 1058450 18501 3449506 203788 1368417 132120 2484771 128 10590 2311329 264790 230656 275197 2837504 271021 3736832 22618 2695940 1475745 72272 2801834 13073 3771400 16995 1710360 2458215 1712136 2432338 532488 494167 3175688 985765 2123088 1446537 2097...
result:
ok 1
Test #38:
score: 0
Accepted
time: 254ms
memory: 26180kb
input:
1026
output:
Yes 2101185 1409042 154209 3745050 705 3469332 658571 1310816 573840 2163240 836614 1180552 326678 1704385 2170930 1364096 2098520 1771648 2113844 436417 1656362 303424 1596575 393824 625933 2252850 891145 1066624 2984245 29378 3868696 315809 2622040 100740 3957865 72466 181444 2435603 529408 363826...
result:
ok 1
Test #39:
score: 0
Accepted
time: 250ms
memory: 26316kb
input:
1027
output:
Yes 3758704 173059 1921996 3106 720964 3178274 917653 29730 3147977 418614 593032 168742 3165185 406192 640331 1443840 565590 1334312 762583 3168512 393899 17428 2527745 1656126 276544 1639946 2236912 344072 660115 2443336 172082 591236 1458283 2174592 819207 1131176 2532677 72194 3024149 1071648 25...
result:
ok 1
Extra Test:
score: 0
Extra Test Passed