QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#374566 | #7868. 天空度假山庄 | NATURAL6 | 100 ✓ | 37ms | 3920kb | C++17 | 639b | 2024-04-02 15:12:30 | 2024-04-02 15:12:31 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
inline int qread()
{
int a=0,f=1;char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
while(isdigit(ch)){(a*=10)+=(ch^48);ch=getchar();}
return a*f;
}
int n,k,p=0;
inline void mov(int x)
{
p=(p+x+n)%n;
printf("%d ",p+1);
return ;
}
inline void solve(int k)
{
++k;
while(k>5)k-=4,mov(k+1),mov(k+4),mov(-k-2),mov(-k-3);
if(k==2)mov(1);
if(k==3)mov(2),mov(-1);
if(k==4)mov(4),mov(-1),mov(-2);
if(k==5)mov(1),mov(5),mov(-2),mov(-3);
return ;
}
int main()
{
n=qread(),k=qread();
for(int i=1;i<n;++i)solve(k);
puts("");
return 0;
}
详细
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 0ms
memory: 3828kb
input:
8216 1
output:
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 10...
result:
ok correct
Test #2:
score: 0
Accepted
time: 1ms
memory: 3832kb
input:
5166 2
output:
3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 54 53 55 ...
result:
ok correct
Test #3:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
7445 2
output:
3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 54 53 55 ...
result:
ok correct
Test #4:
score: 0
Accepted
time: 1ms
memory: 3740kb
input:
1295 2
output:
3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 54 53 55 ...
result:
ok correct
Subtask #2:
score: 20
Accepted
Test #5:
score: 20
Accepted
time: 37ms
memory: 3732kb
input:
86132 9
output:
8 18 10 1 4 10 6 1 2 9 19 11 2 5 11 7 2 3 10 20 12 3 6 12 8 3 4 11 21 13 4 7 13 9 4 5 12 22 14 5 8 14 10 5 6 13 23 15 6 9 15 11 6 7 14 24 16 7 10 16 12 7 8 15 25 17 8 11 17 13 8 9 16 26 18 9 12 18 14 9 10 17 27 19 10 13 19 15 10 11 18 28 20 11 14 20 16 11 12 19 29 21 12 15 21 17 12 13 20 30 22 13 16...
result:
ok correct
Test #6:
score: 0
Accepted
time: 34ms
memory: 3844kb
input:
73452 11
output:
10 22 12 1 6 14 8 1 5 4 2 11 23 13 2 7 15 9 2 6 5 3 12 24 14 3 8 16 10 3 7 6 4 13 25 15 4 9 17 11 4 8 7 5 14 26 16 5 10 18 12 5 9 8 6 15 27 17 6 11 19 13 6 10 9 7 16 28 18 7 12 20 14 7 11 10 8 17 29 19 8 13 21 15 8 12 11 9 18 30 20 9 14 22 16 9 13 12 10 19 31 21 10 15 23 17 10 14 13 11 20 32 22 11 1...
result:
ok correct
Test #7:
score: 0
Accepted
time: 17ms
memory: 3824kb
input:
23283 20
output:
19 40 21 1 15 32 17 1 11 24 13 1 7 16 9 1 2 7 5 2 20 41 22 2 16 33 18 2 12 25 14 2 8 17 10 2 3 8 6 3 21 42 23 3 17 34 19 3 13 26 15 3 9 18 11 3 4 9 7 4 22 43 24 4 18 35 20 4 14 27 16 4 10 19 12 4 5 10 8 5 23 44 25 5 19 36 21 5 15 28 17 5 11 20 13 5 6 11 9 6 24 45 26 6 20 37 22 6 16 29 18 6 12 21 14 ...
result:
ok correct
Test #8:
score: 0
Accepted
time: 26ms
memory: 3860kb
input:
36944 17
output:
16 34 18 1 12 26 14 1 8 18 10 1 4 10 6 1 2 17 35 19 2 13 27 15 2 9 19 11 2 5 11 7 2 3 18 36 20 3 14 28 16 3 10 20 12 3 6 12 8 3 4 19 37 21 4 15 29 17 4 11 21 13 4 7 13 9 4 5 20 38 22 5 16 30 18 5 12 22 14 5 8 14 10 5 6 21 39 23 6 17 31 19 6 13 23 15 6 9 15 11 6 7 22 40 24 7 18 32 20 7 14 24 16 7 10 ...
result:
ok correct
Test #9:
score: 0
Accepted
time: 22ms
memory: 3788kb
input:
61927 10
output:
9 20 11 1 5 12 7 1 3 2 10 21 12 2 6 13 8 2 4 3 11 22 13 3 7 14 9 3 5 4 12 23 14 4 8 15 10 4 6 5 13 24 15 5 9 16 11 5 7 6 14 25 16 6 10 17 12 6 8 7 15 26 17 7 11 18 13 7 9 8 16 27 18 8 12 19 14 8 10 9 17 28 19 9 13 20 15 9 11 10 18 29 20 10 14 21 16 10 12 11 19 30 21 11 15 22 17 11 13 12 20 31 22 12 ...
result:
ok correct
Subtask #3:
score: 20
Accepted
Dependency #2:
100%
Accepted
Test #10:
score: 20
Accepted
time: 0ms
memory: 3920kb
input:
111 17
output:
16 34 18 1 12 26 14 1 8 18 10 1 4 10 6 1 2 17 35 19 2 13 27 15 2 9 19 11 2 5 11 7 2 3 18 36 20 3 14 28 16 3 10 20 12 3 6 12 8 3 4 19 37 21 4 15 29 17 4 11 21 13 4 7 13 9 4 5 20 38 22 5 16 30 18 5 12 22 14 5 8 14 10 5 6 21 39 23 6 17 31 19 6 13 23 15 6 9 15 11 6 7 22 40 24 7 18 32 20 7 14 24 16 7 10 ...
result:
ok correct
Test #11:
score: 0
Accepted
time: 2ms
memory: 3824kb
input:
462 86
output:
85 172 87 1 81 164 83 1 77 156 79 1 73 148 75 1 69 140 71 1 65 132 67 1 61 124 63 1 57 116 59 1 53 108 55 1 49 100 51 1 45 92 47 1 41 84 43 1 37 76 39 1 33 68 35 1 29 60 31 1 25 52 27 1 21 44 23 1 17 36 19 1 13 28 15 1 9 20 11 1 5 12 7 1 3 2 86 173 88 2 82 165 84 2 78 157 80 2 74 149 76 2 70 141 72 ...
result:
ok correct
Test #12:
score: 0
Accepted
time: 1ms
memory: 3824kb
input:
262 43
output:
42 86 44 1 38 78 40 1 34 70 36 1 30 62 32 1 26 54 28 1 22 46 24 1 18 38 20 1 14 30 16 1 10 22 12 1 6 14 8 1 5 4 2 43 87 45 2 39 79 41 2 35 71 37 2 31 63 33 2 27 55 29 2 23 47 25 2 19 39 21 2 15 31 17 2 11 23 13 2 7 15 9 2 6 5 3 44 88 46 3 40 80 42 3 36 72 38 3 32 64 34 3 28 56 30 3 24 48 26 3 20 40 ...
result:
ok correct
Test #13:
score: 0
Accepted
time: 4ms
memory: 3732kb
input:
672 125
output:
124 250 126 1 120 242 122 1 116 234 118 1 112 226 114 1 108 218 110 1 104 210 106 1 100 202 102 1 96 194 98 1 92 186 94 1 88 178 90 1 84 170 86 1 80 162 82 1 76 154 78 1 72 146 74 1 68 138 70 1 64 130 66 1 60 122 62 1 56 114 58 1 52 106 54 1 48 98 50 1 44 90 46 1 40 82 42 1 36 74 38 1 32 66 34 1 28 ...
result:
ok correct
Test #14:
score: 0
Accepted
time: 2ms
memory: 3720kb
input:
747 127
output:
126 254 128 1 122 246 124 1 118 238 120 1 114 230 116 1 110 222 112 1 106 214 108 1 102 206 104 1 98 198 100 1 94 190 96 1 90 182 92 1 86 174 88 1 82 166 84 1 78 158 80 1 74 150 76 1 70 142 72 1 66 134 68 1 62 126 64 1 58 118 60 1 54 110 56 1 50 102 52 1 46 94 48 1 42 86 44 1 38 78 40 1 34 70 36 1 3...
result:
ok correct
Test #15:
score: 0
Accepted
time: 2ms
memory: 3808kb
input:
404 72
output:
71 144 73 1 67 136 69 1 63 128 65 1 59 120 61 1 55 112 57 1 51 104 53 1 47 96 49 1 43 88 45 1 39 80 41 1 35 72 37 1 31 64 33 1 27 56 29 1 23 48 25 1 19 40 21 1 15 32 17 1 11 24 13 1 7 16 9 1 2 7 5 2 72 145 74 2 68 137 70 2 64 129 66 2 60 121 62 2 56 113 58 2 52 105 54 2 48 97 50 2 44 89 46 2 40 81 4...
result:
ok correct
Subtask #4:
score: 20
Accepted
Test #16:
score: 20
Accepted
time: 18ms
memory: 3920kb
input:
1777 229
output:
228 458 230 1 224 450 226 1 220 442 222 1 216 434 218 1 212 426 214 1 208 418 210 1 204 410 206 1 200 402 202 1 196 394 198 1 192 386 194 1 188 378 190 1 184 370 186 1 180 362 182 1 176 354 178 1 172 346 174 1 168 338 170 1 164 330 166 1 160 322 162 1 156 314 158 1 152 306 154 1 148 298 150 1 144 29...
result:
ok correct
Test #17:
score: 0
Accepted
time: 12ms
memory: 3780kb
input:
1129 229
output:
228 458 230 1 224 450 226 1 220 442 222 1 216 434 218 1 212 426 214 1 208 418 210 1 204 410 206 1 200 402 202 1 196 394 198 1 192 386 194 1 188 378 190 1 184 370 186 1 180 362 182 1 176 354 178 1 172 346 174 1 168 338 170 1 164 330 166 1 160 322 162 1 156 314 158 1 152 306 154 1 148 298 150 1 144 29...
result:
ok correct
Test #18:
score: 0
Accepted
time: 36ms
memory: 3740kb
input:
4253 233
output:
232 466 234 1 228 458 230 1 224 450 226 1 220 442 222 1 216 434 218 1 212 426 214 1 208 418 210 1 204 410 206 1 200 402 202 1 196 394 198 1 192 386 194 1 188 378 190 1 184 370 186 1 180 362 182 1 176 354 178 1 172 346 174 1 168 338 170 1 164 330 166 1 160 322 162 1 156 314 158 1 152 306 154 1 148 29...
result:
ok correct
Test #19:
score: 0
Accepted
time: 20ms
memory: 3916kb
input:
2311 233
output:
232 466 234 1 228 458 230 1 224 450 226 1 220 442 222 1 216 434 218 1 212 426 214 1 208 418 210 1 204 410 206 1 200 402 202 1 196 394 198 1 192 386 194 1 188 378 190 1 184 370 186 1 180 362 182 1 176 354 178 1 172 346 174 1 168 338 170 1 164 330 166 1 160 322 162 1 156 314 158 1 152 306 154 1 148 29...
result:
ok correct
Test #20:
score: 0
Accepted
time: 34ms
memory: 3732kb
input:
6712 114
output:
113 228 115 1 109 220 111 1 105 212 107 1 101 204 103 1 97 196 99 1 93 188 95 1 89 180 91 1 85 172 87 1 81 164 83 1 77 156 79 1 73 148 75 1 69 140 71 1 65 132 67 1 61 124 63 1 57 116 59 1 53 108 55 1 49 100 51 1 45 92 47 1 41 84 43 1 37 76 39 1 33 68 35 1 29 60 31 1 25 52 27 1 21 44 23 1 17 36 19 1 ...
result:
ok correct
Test #21:
score: 0
Accepted
time: 6ms
memory: 3744kb
input:
1050 114
output:
113 228 115 1 109 220 111 1 105 212 107 1 101 204 103 1 97 196 99 1 93 188 95 1 89 180 91 1 85 172 87 1 81 164 83 1 77 156 79 1 73 148 75 1 69 140 71 1 65 132 67 1 61 124 63 1 57 116 59 1 53 108 55 1 49 100 51 1 45 92 47 1 41 84 43 1 37 76 39 1 33 68 35 1 29 60 31 1 25 52 27 1 21 44 23 1 17 36 19 1 ...
result:
ok correct
Test #22:
score: 0
Accepted
time: 21ms
memory: 3796kb
input:
1132 514
output:
513 1028 515 1 509 1020 511 1 505 1012 507 1 501 1004 503 1 497 996 499 1 493 988 495 1 489 980 491 1 485 972 487 1 481 964 483 1 477 956 479 1 473 948 475 1 469 940 471 1 465 932 467 1 461 924 463 1 457 916 459 1 453 908 455 1 449 900 451 1 445 892 447 1 441 884 443 1 437 876 439 1 433 868 435 1 42...
result:
ok correct
Test #23:
score: 0
Accepted
time: 27ms
memory: 3784kb
input:
1130 514
output:
513 1028 515 1 509 1020 511 1 505 1012 507 1 501 1004 503 1 497 996 499 1 493 988 495 1 489 980 491 1 485 972 487 1 481 964 483 1 477 956 479 1 473 948 475 1 469 940 471 1 465 932 467 1 461 924 463 1 457 916 459 1 453 908 455 1 449 900 451 1 445 892 447 1 441 884 443 1 437 876 439 1 433 868 435 1 42...
result:
ok correct
Subtask #5:
score: 35
Accepted
Dependency #1:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Test #24:
score: 35
Accepted
time: 24ms
memory: 3736kb
input:
1151 564
output:
563 1128 565 1 559 1120 561 1 555 1112 557 1 551 1104 553 1 547 1096 549 1 543 1088 545 1 539 1080 541 1 535 1072 537 1 531 1064 533 1 527 1056 529 1 523 1048 525 1 519 1040 521 1 515 1032 517 1 511 1024 513 1 507 1016 509 1 503 1008 505 1 499 1000 501 1 495 992 497 1 491 984 493 1 487 976 489 1 483...
result:
ok correct
Test #25:
score: 0
Accepted
time: 23ms
memory: 3916kb
input:
1042 511
output:
510 1022 512 1 506 1014 508 1 502 1006 504 1 498 998 500 1 494 990 496 1 490 982 492 1 486 974 488 1 482 966 484 1 478 958 480 1 474 950 476 1 470 942 472 1 466 934 468 1 462 926 464 1 458 918 460 1 454 910 456 1 450 902 452 1 446 894 448 1 442 886 444 1 438 878 440 1 434 870 436 1 430 862 432 1 426...
result:
ok correct
Test #26:
score: 0
Accepted
time: 29ms
memory: 3788kb
input:
1170 575
output:
574 1150 576 1 570 1142 572 1 566 1134 568 1 562 1126 564 1 558 1118 560 1 554 1110 556 1 550 1102 552 1 546 1094 548 1 542 1086 544 1 538 1078 540 1 534 1070 536 1 530 1062 532 1 526 1054 528 1 522 1046 524 1 518 1038 520 1 514 1030 516 1 510 1022 512 1 506 1014 508 1 502 1006 504 1 498 998 500 1 4...
result:
ok correct
Test #27:
score: 0
Accepted
time: 29ms
memory: 3836kb
input:
1249 615
output:
614 1230 616 1 610 1222 612 1 606 1214 608 1 602 1206 604 1 598 1198 600 1 594 1190 596 1 590 1182 592 1 586 1174 588 1 582 1166 584 1 578 1158 580 1 574 1150 576 1 570 1142 572 1 566 1134 568 1 562 1126 564 1 558 1118 560 1 554 1110 556 1 550 1102 552 1 546 1094 548 1 542 1086 544 1 538 1078 540 1 ...
result:
ok correct
Test #28:
score: 0
Accepted
time: 13ms
memory: 3848kb
input:
746 364
output:
363 728 365 1 359 720 361 1 355 712 357 1 351 704 353 1 347 696 349 1 343 688 345 1 339 680 341 1 335 672 337 1 331 664 333 1 327 656 329 1 323 648 325 1 319 640 321 1 315 632 317 1 311 624 313 1 307 616 309 1 303 608 305 1 299 600 301 1 295 592 297 1 291 584 293 1 287 576 289 1 283 568 285 1 279 56...
result:
ok correct
Test #29:
score: 0
Accepted
time: 28ms
memory: 3860kb
input:
1146 565
output:
564 1130 566 1 560 1122 562 1 556 1114 558 1 552 1106 554 1 548 1098 550 1 544 1090 546 1 540 1082 542 1 536 1074 538 1 532 1066 534 1 528 1058 530 1 524 1050 526 1 520 1042 522 1 516 1034 518 1 512 1026 514 1 508 1018 510 1 504 1010 506 1 500 1002 502 1 496 994 498 1 492 986 494 1 488 978 490 1 484...
result:
ok correct
Test #30:
score: 0
Accepted
time: 7ms
memory: 3836kb
input:
554 265
output:
264 530 266 1 260 522 262 1 256 514 258 1 252 506 254 1 248 498 250 1 244 490 246 1 240 482 242 1 236 474 238 1 232 466 234 1 228 458 230 1 224 450 226 1 220 442 222 1 216 434 218 1 212 426 214 1 208 418 210 1 204 410 206 1 200 402 202 1 196 394 198 1 192 386 194 1 188 378 190 1 184 370 186 1 180 36...
result:
ok correct
Test #31:
score: 0
Accepted
time: 20ms
memory: 3744kb
input:
1061 519
output:
518 1038 520 1 514 1030 516 1 510 1022 512 1 506 1014 508 1 502 1006 504 1 498 998 500 1 494 990 496 1 490 982 492 1 486 974 488 1 482 966 484 1 478 958 480 1 474 950 476 1 470 942 472 1 466 934 468 1 462 926 464 1 458 918 460 1 454 910 456 1 450 902 452 1 446 894 448 1 442 886 444 1 438 878 440 1 4...
result:
ok correct
Test #32:
score: 0
Accepted
time: 1ms
memory: 3808kb
input:
173 78
output:
77 156 79 1 73 148 75 1 69 140 71 1 65 132 67 1 61 124 63 1 57 116 59 1 53 108 55 1 49 100 51 1 45 92 47 1 41 84 43 1 37 76 39 1 33 68 35 1 29 60 31 1 25 52 27 1 21 44 23 1 17 36 19 1 13 28 15 1 9 20 11 1 5 12 7 1 3 2 78 157 80 2 74 149 76 2 70 141 72 2 66 133 68 2 62 125 64 2 58 117 60 2 54 109 56 ...
result:
ok correct
Test #33:
score: 0
Accepted
time: 17ms
memory: 3816kb
input:
884 430
output:
429 860 431 1 425 852 427 1 421 844 423 1 417 836 419 1 413 828 415 1 409 820 411 1 405 812 407 1 401 804 403 1 397 796 399 1 393 788 395 1 389 780 391 1 385 772 387 1 381 764 383 1 377 756 379 1 373 748 375 1 369 740 371 1 365 732 367 1 361 724 363 1 357 716 359 1 353 708 355 1 349 700 351 1 345 69...
result:
ok correct
Test #34:
score: 0
Accepted
time: 25ms
memory: 3828kb
input:
1089 537
output:
536 1074 538 1 532 1066 534 1 528 1058 530 1 524 1050 526 1 520 1042 522 1 516 1034 518 1 512 1026 514 1 508 1018 510 1 504 1010 506 1 500 1002 502 1 496 994 498 1 492 986 494 1 488 978 490 1 484 970 486 1 480 962 482 1 476 954 478 1 472 946 474 1 468 938 470 1 464 930 466 1 460 922 462 1 456 914 45...
result:
ok correct
Test #35:
score: 0
Accepted
time: 2ms
memory: 3812kb
input:
433 207
output:
206 414 208 1 202 406 204 1 198 398 200 1 194 390 196 1 190 382 192 1 186 374 188 1 182 366 184 1 178 358 180 1 174 350 176 1 170 342 172 1 166 334 168 1 162 326 164 1 158 318 160 1 154 310 156 1 150 302 152 1 146 294 148 1 142 286 144 1 138 278 140 1 134 270 136 1 130 262 132 1 126 254 128 1 122 24...
result:
ok correct