QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#527567#7868. 天空度假山庄asupersalmon60 46ms4060kbC++141.3kb2024-08-22 17:04:202024-08-22 17:04:21

Judging History

你现在查看的是最新测评结果

  • [2024-08-22 17:04:21]
  • 评测
  • 测评结果:60
  • 用时:46ms
  • 内存:4060kb
  • [2024-08-22 17:04:20]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int N;
int K;

int main(){
    scanf(" %d",&N);
    scanf(" %d",&K);

    int num = (N-1)/2;
    long long int sum = 0;

    vector<int> v;
    vector<int> ans;

    for(int i = 1; i <= K; i++){
        v.push_back(i);
        sum += i;
    }

    sum %= N;

    if(sum == 0){
        ans.push_back(v.back() + 1);
        v.pop_back();
        while(!v.empty()){
            ans.push_back(v.back());
            v.pop_back();
        }
    }
    else if(sum == 1){
        while(!v.empty()){
            ans.push_back(v.back());
            v.pop_back();
        }
    }
    else{
        int fum = N + 1 - sum;

        for(int i = K; i >= 1; i--,num--){
            if(fum <= num - i){
                v.pop_back();
                ans.push_back(fum + i);
                break;
            }
            else{
                fum -= (num - i);
                ans.push_back(num);
                v.pop_back();
            }
        }

        while(!v.empty()){
            ans.push_back(v.back());
            v.pop_back();
        }
    }

    int p = 1;

    for(int i = 1; i < N; i++){
        for(int j = 0; j < K; j++){
            p = (p + ans[j] - 1) % N + 1;
            printf("%d ",p);
        }
    }

}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 5
Accepted
time: 1ms
memory: 3796kb

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
Wrong Answer
time: 1ms
memory: 4032kb

input:

5166 2

output:

2583 5164 2580 5161 2577 5158 2574 5155 2571 5152 2568 5149 2565 5146 2562 5143 2559 5140 2556 5137 2553 5134 2550 5131 2547 5128 2544 5125 2541 5122 2538 5119 2535 5116 2532 5113 2529 5110 2526 5107 2523 5104 2520 5101 2517 5098 2514 5095 2511 5092 2508 5089 2505 5086 2502 5083 2499 5080 2496 5077 ...

result:

wrong answer visit same point several times.

Subtask #2:

score: 20
Accepted

Test #5:

score: 20
Accepted
time: 33ms
memory: 4028kb

input:

86132 9

output:

43066 86106 86113 86119 86124 86128 86131 1 2 43067 86107 86114 86120 86125 86129 86132 2 3 43068 86108 86115 86121 86126 86130 1 3 4 43069 86109 86116 86122 86127 86131 2 4 5 43070 86110 86117 86123 86128 86132 3 5 6 43071 86111 86118 86124 86129 1 4 6 7 43072 86112 86119 86125 86130 2 5 7 8 43073 ...

result:

ok correct

Test #6:

score: 20
Accepted
time: 35ms
memory: 4060kb

input:

73452 11

output:

36726 73409 73418 73426 73433 73439 73444 73448 73451 1 2 36727 73410 73419 73427 73434 73440 73445 73449 73452 2 3 36728 73411 73420 73428 73435 73441 73446 73450 1 3 4 36729 73412 73421 73429 73436 73442 73447 73451 2 4 5 36730 73413 73422 73430 73437 73443 73448 73452 3 5 6 36731 73414 73423 7343...

result:

ok correct

Test #7:

score: 20
Accepted
time: 23ms
memory: 3864kb

input:

23283 20

output:

11642 23114 23132 23149 23165 23180 23194 23207 23219 23230 23240 23249 23257 23264 23270 23275 23279 23282 1 2 11643 23115 23133 23150 23166 23181 23195 23208 23220 23231 23241 23250 23258 23265 23271 23276 23280 23283 2 3 11644 23116 23134 23151 23167 23182 23196 23209 23221 23232 23242 23251 2325...

result:

ok correct

Test #8:

score: 20
Accepted
time: 25ms
memory: 3796kb

input:

36944 17

output:

18472 36826 36841 36855 36868 36880 36891 36901 36910 36918 36925 36931 36936 36940 36943 1 2 18473 36827 36842 36856 36869 36881 36892 36902 36911 36919 36926 36932 36937 36941 36944 2 3 18474 36828 36843 36857 36870 36882 36893 36903 36912 36920 36927 36933 36938 36942 1 3 4 18475 36829 36844 3685...

result:

ok correct

Test #9:

score: 20
Accepted
time: 26ms
memory: 3856kb

input:

61927 10

output:

30964 61893 61901 61908 61914 61919 61923 61926 1 2 30965 61894 61902 61909 61915 61920 61924 61927 2 3 30966 61895 61903 61910 61916 61921 61925 1 3 4 30967 61896 61904 61911 61917 61922 61926 2 4 5 30968 61897 61905 61912 61918 61923 61927 3 5 6 30969 61898 61906 61913 61919 61924 1 4 6 7 30970 61...

result:

ok correct

Subtask #3:

score: 20
Accepted

Dependency #2:

100%
Accepted

Test #10:

score: 20
Accepted
time: 0ms
memory: 3768kb

input:

111 17

output:

56 104 8 22 35 47 58 68 77 85 92 98 103 107 110 1 2 57 105 9 23 36 48 59 69 78 86 93 99 104 108 111 2 3 58 106 10 24 37 49 60 70 79 87 94 100 105 109 1 3 4 59 107 11 25 38 50 61 71 80 88 95 101 106 110 2 4 5 60 108 12 26 39 51 62 72 81 89 96 102 107 111 3 5 6 61 109 13 27 40 52 63 73 82 90 97 103 10...

result:

ok correct

Test #11:

score: 20
Accepted
time: 2ms
memory: 3840kb

input:

462 86

output:

231 460 212 295 377 458 76 155 233 310 386 461 73 146 218 289 359 428 34 101 167 232 296 359 421 20 80 139 197 254 310 365 419 10 62 113 163 212 260 307 353 398 442 23 65 106 146 185 223 260 296 331 365 398 430 461 29 58 86 113 139 164 188 211 233 254 274 293 311 328 344 359 373 386 398 409 419 428 ...

result:

ok correct

Test #12:

score: 20
Accepted
time: 1ms
memory: 3860kb

input:

262 43

output:

131 189 230 8 47 85 122 158 193 227 260 30 61 91 120 148 175 201 226 250 11 33 54 74 93 111 128 144 159 173 186 198 209 219 228 236 243 249 254 258 261 1 2 132 190 231 9 48 86 123 159 194 228 261 31 62 92 121 149 176 202 227 251 12 34 55 75 94 112 129 145 160 174 187 199 210 220 229 237 244 250 255 ...

result:

ok correct

Test #13:

score: 20
Accepted
time: 4ms
memory: 3720kb

input:

672 125

output:

316 440 563 13 134 254 373 491 608 52 167 281 394 506 617 55 164 272 379 485 590 22 125 227 328 428 527 625 50 146 241 335 428 520 611 29 118 206 293 379 464 548 631 41 122 202 281 359 436 512 587 661 62 134 205 275 344 412 479 545 610 2 65 127 188 248 307 365 422 478 533 587 640 20 71 121 170 218 2...

result:

ok correct

Test #14:

score: 20
Accepted
time: 5ms
memory: 3800kb

input:

747 127

output:

218 344 469 593 716 91 212 332 451 569 686 55 170 284 397 509 620 730 92 200 307 413 518 622 725 80 181 281 380 478 575 671 19 113 206 298 389 479 568 656 743 82 167 251 334 416 497 577 656 734 64 140 215 289 362 434 505 575 644 712 32 98 163 227 290 352 413 473 532 590 647 703 11 65 118 170 221 271...

result:

ok correct

Test #15:

score: 20
Accepted
time: 2ms
memory: 3792kb

input:

404 72

output:

202 345 11 80 148 215 281 346 6 69 131 192 252 311 369 22 78 133 187 240 292 343 393 38 86 133 179 224 268 311 353 394 30 69 107 144 180 215 249 282 314 345 375 404 28 55 81 106 130 153 175 196 216 235 253 270 286 301 315 328 340 351 361 370 378 385 391 396 400 403 1 2 203 346 12 81 149 216 282 347 ...

result:

ok correct

Subtask #4:

score: 20
Accepted

Test #16:

score: 20
Accepted
time: 15ms
memory: 4060kb

input:

1777 229

output:

551 779 1006 1232 1457 1681 127 349 570 790 1009 1227 1444 1660 98 312 525 737 948 1158 1367 1575 5 211 416 620 823 1025 1226 1426 1625 46 243 439 634 828 1021 1213 1404 1594 6 194 381 567 752 936 1119 1301 1482 1662 64 242 419 595 770 944 1117 1289 1460 1630 22 190 357 523 688 852 1015 1177 1338 14...

result:

ok correct

Test #17:

score: 20
Accepted
time: 12ms
memory: 3768kb

input:

1129 229

output:

565 1128 318 544 769 993 87 309 530 750 969 58 275 491 706 920 4 216 427 637 846 1054 132 338 543 747 950 23 224 424 623 821 1018 85 280 474 667 859 1050 111 300 488 675 861 1046 101 284 466 647 827 1006 55 232 408 583 757 930 1102 144 314 483 651 818 984 20 184 347 509 670 830 989 18 175 331 486 64...

result:

ok correct

Test #18:

score: 20
Accepted
time: 46ms
memory: 3788kb

input:

4253 233

output:

2127 2977 3208 3438 3667 3895 4122 95 320 544 767 989 1210 1430 1649 1867 2084 2300 2515 2729 2942 3154 3365 3575 3784 3992 4199 152 357 561 764 966 1167 1367 1566 1764 1961 2157 2352 2546 2739 2931 3122 3312 3501 3689 3876 4062 4247 178 361 543 724 904 1083 1261 1438 1614 1789 1963 2136 2308 2479 2...

result:

ok correct

Test #19:

score: 20
Accepted
time: 25ms
memory: 3772kb

input:

2311 233

output:

706 938 1169 1399 1628 1856 2083 2309 223 447 670 892 1113 1333 1552 1770 1987 2203 107 321 534 746 957 1167 1376 1584 1791 1997 2202 95 298 500 701 901 1100 1298 1495 1691 1886 2080 2273 154 345 535 724 912 1099 1285 1470 1654 1837 2019 2200 69 248 426 603 779 954 1128 1301 1473 1644 1814 1983 2151...

result:

ok correct

Test #20:

score: 20
Accepted
time: 35ms
memory: 3772kb

input:

6712 114

output:

273 386 498 609 719 828 936 1043 1149 1254 1358 1461 1563 1664 1764 1863 1961 2058 2154 2249 2343 2436 2528 2619 2709 2798 2886 2973 3059 3144 3228 3311 3393 3474 3554 3633 3711 3788 3864 3939 4013 4086 4158 4229 4299 4368 4436 4503 4569 4634 4698 4761 4823 4884 4944 5003 5061 5118 5174 5229 5283 53...

result:

ok correct

Test #21:

score: 20
Accepted
time: 6ms
memory: 3776kb

input:

1050 114

output:

525 1024 86 197 307 416 524 631 737 842 946 1049 101 202 302 401 499 596 692 787 881 974 16 107 197 286 374 461 547 632 716 799 881 962 1042 71 149 226 302 377 451 524 596 667 737 806 874 941 1007 22 86 149 211 272 332 391 449 506 562 617 671 724 776 827 877 926 974 1021 17 62 106 149 191 232 272 31...

result:

ok correct

Test #22:

score: 20
Accepted
time: 27ms
memory: 3780kb

input:

1132 514

output:

566 1118 498 1009 387 896 272 779 153 658 30 533 1035 404 904 271 769 134 630 1125 487 980 340 831 189 678 34 521 1007 360 844 195 677 26 506 985 331 808 152 627 1101 442 914 253 723 60 528 995 329 794 126 589 1051 380 840 167 625 1082 406 861 183 636 1088 407 857 174 622 1069 383 828 140 583 1025 3...

result:

ok correct

Test #23:

score: 20
Accepted
time: 27ms
memory: 3808kb

input:

1130 514

output:

565 1128 560 1121 551 1110 538 1095 521 1076 500 1053 475 1026 446 995 413 960 376 907 271 764 126 617 1107 466 954 311 797 152 636 1119 471 952 302 781 129 606 1082 427 901 244 716 57 527 996 334 801 137 602 1066 399 861 192 652 1111 439 896 222 677 1 454 906 227 677 1126 444 891 207 652 1096 409 8...

result:

ok correct

Subtask #5:

score: 0
Skipped

Dependency #1:

0%