QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#265003 | #7868. 天空度假山庄 | zyz07 | 45 | 42ms | 3820kb | C++17 | 695b | 2023-11-25 16:21:57 | 2023-11-25 16:21:57 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define For(Ti,Ta,Tb) for(auto Ti=(Ta);Ti<=(Tb);++Ti)
#define Dec(Ti,Ta,Tb) for(auto Ti=(Ta);Ti>=(Tb);--Ti)
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define range(Tx) begin(Tx),end(Tx)
using ll=long long;
int n,k;
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
cin>>n>>k;
vector<int> vec;
int sum=0;
for(int i=1,x=n/2-1;i<k-1;i+=2){
vec.push_back(-(x--));
vec.push_back(x--);
--sum;
}
if(k%2){
vec.push_back(1-sum);
}else{
vec.push_back(-1);
vec.push_back(2-sum);
}
For(i,1,n-1){
int u=i;
For(j,1,k){
u=(u+vec[j-1]+n-1)%n+1;
cout<<u<<' ';
}
}
cout<<'\n';
return 0;
}
詳細信息
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 1ms
memory: 3520kb
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: 3520kb
input:
5166 2
output:
5166 2 1 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 ...
result:
ok correct
Test #3:
score: 0
Accepted
time: 1ms
memory: 3512kb
input:
7445 2
output:
7445 2 1 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 ...
result:
ok correct
Test #4:
score: 0
Accepted
time: 1ms
memory: 3772kb
input:
1295 2
output:
1295 2 1 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 ...
result:
ok correct
Subtask #2:
score: 20
Accepted
Test #5:
score: 20
Accepted
time: 31ms
memory: 3476kb
input:
86132 9
output:
43068 86132 43069 86131 43070 86130 43071 86129 2 43069 1 43070 86132 43071 86131 43072 86130 3 43070 2 43071 1 43072 86132 43073 86131 4 43071 3 43072 2 43073 1 43074 86132 5 43072 4 43073 3 43074 2 43075 1 6 43073 5 43074 4 43075 3 43076 2 7 43074 6 43075 5 43076 4 43077 3 8 43075 7 43076 6 43077 ...
result:
ok correct
Test #6:
score: 0
Accepted
time: 32ms
memory: 3520kb
input:
73452 11
output:
36728 73452 36729 73451 36730 73450 36731 73449 36732 73448 2 36729 1 36730 73452 36731 73451 36732 73450 36733 73449 3 36730 2 36731 1 36732 73452 36733 73451 36734 73450 4 36731 3 36732 2 36733 1 36734 73452 36735 73451 5 36732 4 36733 3 36734 2 36735 1 36736 73452 6 36733 5 36734 4 36735 3 36736 ...
result:
ok correct
Test #7:
score: 0
Accepted
time: 21ms
memory: 3524kb
input:
23283 20
output:
11644 23283 11645 23282 11646 23281 11647 23280 11648 23279 11649 23278 11650 23277 11651 23276 11652 23275 23274 2 11645 1 11646 23283 11647 23282 11648 23281 11649 23280 11650 23279 11651 23278 11652 23277 11653 23276 23275 3 11646 2 11647 1 11648 23283 11649 23282 11650 23281 11651 23280 11652 23...
result:
ok correct
Test #8:
score: 0
Accepted
time: 28ms
memory: 3748kb
input:
36944 17
output:
18474 36944 18475 36943 18476 36942 18477 36941 18478 36940 18479 36939 18480 36938 18481 36937 2 18475 1 18476 36944 18477 36943 18478 36942 18479 36941 18480 36940 18481 36939 18482 36938 3 18476 2 18477 1 18478 36944 18479 36943 18480 36942 18481 36941 18482 36940 18483 36939 4 18477 3 18478 2 18...
result:
ok correct
Test #9:
score: 0
Accepted
time: 24ms
memory: 3520kb
input:
61927 10
output:
30966 61927 30967 61926 30968 61925 30969 61924 61923 2 30967 1 30968 61927 30969 61926 30970 61925 61924 3 30968 2 30969 1 30970 61927 30971 61926 61925 4 30969 3 30970 2 30971 1 30972 61927 61926 5 30970 4 30971 3 30972 2 30973 1 61927 6 30971 5 30972 4 30973 3 30974 2 1 7 30972 6 30973 5 30974 4 ...
result:
ok correct
Subtask #3:
score: 20
Accepted
Dependency #2:
100%
Accepted
Test #10:
score: 20
Accepted
time: 1ms
memory: 3816kb
input:
111 17
output:
58 111 59 110 60 109 61 108 62 107 63 106 64 105 65 104 2 59 1 60 111 61 110 62 109 63 108 64 107 65 106 66 105 3 60 2 61 1 62 111 63 110 64 109 65 108 66 107 67 106 4 61 3 62 2 63 1 64 111 65 110 66 109 67 108 68 107 5 62 4 63 3 64 2 65 1 66 111 67 110 68 109 69 108 6 63 5 64 4 65 3 66 2 67 1 68 11...
result:
ok correct
Test #11:
score: 0
Accepted
time: 2ms
memory: 3592kb
input:
462 86
output:
233 462 234 461 235 460 236 459 237 458 238 457 239 456 240 455 241 454 242 453 243 452 244 451 245 450 246 449 247 448 248 447 249 446 250 445 251 444 252 443 253 442 254 441 255 440 256 439 257 438 258 437 259 436 260 435 261 434 262 433 263 432 264 431 265 430 266 429 267 428 268 427 269 426 270 ...
result:
ok correct
Test #12:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
262 43
output:
133 262 134 261 135 260 136 259 137 258 138 257 139 256 140 255 141 254 142 253 143 252 144 251 145 250 146 249 147 248 148 247 149 246 150 245 151 244 152 243 153 242 2 134 1 135 262 136 261 137 260 138 259 139 258 140 257 141 256 142 255 143 254 144 253 145 252 146 251 147 250 148 249 149 248 150 ...
result:
ok correct
Test #13:
score: 0
Accepted
time: 4ms
memory: 3776kb
input:
672 125
output:
338 672 339 671 340 670 341 669 342 668 343 667 344 666 345 665 346 664 347 663 348 662 349 661 350 660 351 659 352 658 353 657 354 656 355 655 356 654 357 653 358 652 359 651 360 650 361 649 362 648 363 647 364 646 365 645 366 644 367 643 368 642 369 641 370 640 371 639 372 638 373 637 374 636 375 ...
result:
ok correct
Test #14:
score: 0
Accepted
time: 4ms
memory: 3820kb
input:
747 127
output:
376 747 377 746 378 745 379 744 380 743 381 742 382 741 383 740 384 739 385 738 386 737 387 736 388 735 389 734 390 733 391 732 392 731 393 730 394 729 395 728 396 727 397 726 398 725 399 724 400 723 401 722 402 721 403 720 404 719 405 718 406 717 407 716 408 715 409 714 410 713 411 712 412 711 413 ...
result:
ok correct
Test #15:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
404 72
output:
204 404 205 403 206 402 207 401 208 400 209 399 210 398 211 397 212 396 213 395 214 394 215 393 216 392 217 391 218 390 219 389 220 388 221 387 222 386 223 385 224 384 225 383 226 382 227 381 228 380 229 379 230 378 231 377 232 376 233 375 234 374 235 373 236 372 237 371 238 370 369 2 205 1 206 404 ...
result:
ok correct
Subtask #4:
score: 0
Wrong Answer
Test #16:
score: 20
Accepted
time: 17ms
memory: 3544kb
input:
1777 229
output:
891 1777 892 1776 893 1775 894 1774 895 1773 896 1772 897 1771 898 1770 899 1769 900 1768 901 1767 902 1766 903 1765 904 1764 905 1763 906 1762 907 1761 908 1760 909 1759 910 1758 911 1757 912 1756 913 1755 914 1754 915 1753 916 1752 917 1751 918 1750 919 1749 920 1748 921 1747 922 1746 923 1745 924...
result:
ok correct
Test #17:
score: 0
Accepted
time: 11ms
memory: 3600kb
input:
1129 229
output:
567 1129 568 1128 569 1127 570 1126 571 1125 572 1124 573 1123 574 1122 575 1121 576 1120 577 1119 578 1118 579 1117 580 1116 581 1115 582 1114 583 1113 584 1112 585 1111 586 1110 587 1109 588 1108 589 1107 590 1106 591 1105 592 1104 593 1103 594 1102 595 1101 596 1100 597 1099 598 1098 599 1097 600...
result:
ok correct
Test #18:
score: 0
Accepted
time: 42ms
memory: 3596kb
input:
4253 233
output:
2129 4253 2130 4252 2131 4251 2132 4250 2133 4249 2134 4248 2135 4247 2136 4246 2137 4245 2138 4244 2139 4243 2140 4242 2141 4241 2142 4240 2143 4239 2144 4238 2145 4237 2146 4236 2147 4235 2148 4234 2149 4233 2150 4232 2151 4231 2152 4230 2153 4229 2154 4228 2155 4227 2156 4226 2157 4225 2158 4224 ...
result:
ok correct
Test #19:
score: 0
Accepted
time: 24ms
memory: 3480kb
input:
2311 233
output:
1158 2311 1159 2310 1160 2309 1161 2308 1162 2307 1163 2306 1164 2305 1165 2304 1166 2303 1167 2302 1168 2301 1169 2300 1170 2299 1171 2298 1172 2297 1173 2296 1174 2295 1175 2294 1176 2293 1177 2292 1178 2291 1179 2290 1180 2289 1181 2288 1182 2287 1183 2286 1184 2285 1185 2284 1186 2283 1187 2282 ...
result:
ok correct
Test #20:
score: 0
Accepted
time: 28ms
memory: 3612kb
input:
6712 114
output:
3358 6712 3359 6711 3360 6710 3361 6709 3362 6708 3363 6707 3364 6706 3365 6705 3366 6704 3367 6703 3368 6702 3369 6701 3370 6700 3371 6699 3372 6698 3373 6697 3374 6696 3375 6695 3376 6694 3377 6693 3378 6692 3379 6691 3380 6690 3381 6689 3382 6688 3383 6687 3384 6686 3385 6685 3386 6684 3387 6683 ...
result:
ok correct
Test #21:
score: 0
Accepted
time: 3ms
memory: 3484kb
input:
1050 114
output:
527 1050 528 1049 529 1048 530 1047 531 1046 532 1045 533 1044 534 1043 535 1042 536 1041 537 1040 538 1039 539 1038 540 1037 541 1036 542 1035 543 1034 544 1033 545 1032 546 1031 547 1030 548 1029 549 1028 550 1027 551 1026 552 1025 553 1024 554 1023 555 1022 556 1021 557 1020 558 1019 559 1018 560...
result:
ok correct
Test #22:
score: -20
Wrong Answer
time: 20ms
memory: 3480kb
input:
1132 514
output:
568 1132 569 1131 570 1130 571 1129 572 1128 573 1127 574 1126 575 1125 576 1124 577 1123 578 1122 579 1121 580 1120 581 1119 582 1118 583 1117 584 1116 585 1115 586 1114 587 1113 588 1112 589 1111 590 1110 591 1109 592 1108 593 1107 594 1106 595 1105 596 1104 597 1103 598 1102 599 1101 600 1100 601...
result:
wrong answer visit same point several times.
Subtask #5:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
0%