QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#265018#7868. 天空度假山庄zyz07100 ✓39ms3864kbC++17790b2023-11-25 16:25:092023-11-25 16:25:10

Judging History

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

  • [2023-11-25 16:25:10]
  • 评测
  • 测评结果:100
  • 用时:39ms
  • 内存:3864kb
  • [2023-11-25 16:25:09]
  • 提交

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){
		if(sum>-2){
			vec.push_back(-(x--));
			vec.push_back(x--);
			--sum;
		}else{
			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;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

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

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: 3624kb

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: 3528kb

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: 0ms
memory: 3568kb

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: 3600kb

input:

86132 9

output:

43068 86132 43069 86131 43060 86132 43073 86131 2 43069 1 43070 86132 43061 1 43074 86132 3 43070 2 43071 1 43062 2 43075 1 4 43071 3 43072 2 43063 3 43076 2 5 43072 4 43073 3 43064 4 43077 3 6 43073 5 43074 4 43065 5 43078 4 7 43074 6 43075 5 43066 6 43079 5 8 43075 7 43076 6 43067 7 43080 6 9 4307...

result:

ok correct

Test #6:

score: 0
Accepted
time: 25ms
memory: 3620kb

input:

73452 11

output:

36728 73452 36729 73451 36720 73452 36733 73451 36716 73452 2 36729 1 36730 73452 36721 1 36734 73452 36717 1 3 36730 2 36731 1 36722 2 36735 1 36718 2 4 36731 3 36732 2 36723 3 36736 2 36719 3 5 36732 4 36733 3 36724 4 36737 3 36720 4 6 36733 5 36734 4 36725 5 36738 4 36721 5 7 36734 6 36735 5 3672...

result:

ok correct

Test #7:

score: 0
Accepted
time: 12ms
memory: 3632kb

input:

23283 20

output:

11644 23283 11645 23282 11635 23283 11649 23282 11631 23283 11653 23282 11627 23283 11657 23282 11623 23283 23282 2 11645 1 11646 23283 11636 1 11650 23283 11632 1 11654 23283 11628 1 11658 23283 11624 1 23283 3 11646 2 11647 1 11637 2 11651 1 11633 2 11655 1 11629 2 11659 1 11625 2 1 4 11647 3 1164...

result:

ok correct

Test #8:

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

input:

36944 17

output:

18474 36944 18475 36943 18466 36944 18479 36943 18462 36944 18483 36943 18458 36944 18487 36943 2 18475 1 18476 36944 18467 1 18480 36944 18463 1 18484 36944 18459 1 18488 36944 3 18476 2 18477 1 18468 2 18481 1 18464 2 18485 1 18460 2 18489 1 4 18477 3 18478 2 18469 3 18482 2 18465 3 18486 2 18461 ...

result:

ok correct

Test #9:

score: 0
Accepted
time: 24ms
memory: 3864kb

input:

61927 10

output:

30966 61927 30967 61926 30957 61927 30971 61926 61925 2 30967 1 30968 61927 30958 1 30972 61927 61926 3 30968 2 30969 1 30959 2 30973 1 61927 4 30969 3 30970 2 30960 3 30974 2 1 5 30970 4 30971 3 30961 4 30975 3 2 6 30971 5 30972 4 30962 5 30976 4 3 7 30972 6 30973 5 30963 6 30977 5 4 8 30973 7 3097...

result:

ok correct

Subtask #3:

score: 20
Accepted

Dependency #2:

100%
Accepted

Test #10:

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

input:

111 17

output:

58 111 59 110 49 111 63 110 45 111 67 110 41 111 71 110 2 59 1 60 111 50 1 64 111 46 1 68 111 42 1 72 111 3 60 2 61 1 51 2 65 1 47 2 69 1 43 2 73 1 4 61 3 62 2 52 3 66 2 48 3 70 2 44 3 74 2 5 62 4 63 3 53 4 67 3 49 4 71 3 45 4 75 3 6 63 5 64 4 54 5 68 4 50 5 72 4 46 5 76 4 7 64 6 65 5 55 6 69 5 51 6...

result:

ok correct

Test #11:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

462 86

output:

233 462 234 461 225 462 238 461 221 462 242 461 217 462 246 461 213 462 250 461 209 462 254 461 205 462 258 461 201 462 262 461 197 462 266 461 193 462 270 461 189 462 274 461 185 462 278 461 181 462 282 461 177 462 286 461 173 462 290 461 169 462 294 461 165 462 298 461 161 462 302 461 157 462 306 ...

result:

ok correct

Test #12:

score: 0
Accepted
time: 1ms
memory: 3852kb

input:

262 43

output:

133 262 134 261 125 262 138 261 121 262 142 261 117 262 146 261 113 262 150 261 109 262 154 261 105 262 158 261 101 262 162 261 97 262 166 261 93 262 170 261 89 262 2 134 1 135 262 126 1 139 262 122 1 143 262 118 1 147 262 114 1 151 262 110 1 155 262 106 1 159 262 102 1 163 262 98 1 167 262 94 1 171...

result:

ok correct

Test #13:

score: 0
Accepted
time: 4ms
memory: 3488kb

input:

672 125

output:

338 672 339 671 330 672 343 671 326 672 347 671 322 672 351 671 318 672 355 671 314 672 359 671 310 672 363 671 306 672 367 671 302 672 371 671 298 672 375 671 294 672 379 671 290 672 383 671 286 672 387 671 282 672 391 671 278 672 395 671 274 672 399 671 270 672 403 671 266 672 407 671 262 672 411 ...

result:

ok correct

Test #14:

score: 0
Accepted
time: 4ms
memory: 3620kb

input:

747 127

output:

376 747 377 746 367 747 381 746 363 747 385 746 359 747 389 746 355 747 393 746 351 747 397 746 347 747 401 746 343 747 405 746 339 747 409 746 335 747 413 746 331 747 417 746 327 747 421 746 323 747 425 746 319 747 429 746 315 747 433 746 311 747 437 746 307 747 441 746 303 747 445 746 299 747 449 ...

result:

ok correct

Test #15:

score: 0
Accepted
time: 2ms
memory: 3504kb

input:

404 72

output:

204 404 205 403 196 404 209 403 192 404 213 403 188 404 217 403 184 404 221 403 180 404 225 403 176 404 229 403 172 404 233 403 168 404 237 403 164 404 241 403 160 404 245 403 156 404 249 403 152 404 253 403 148 404 257 403 144 404 261 403 140 404 265 403 136 404 269 403 132 404 403 2 205 1 206 404 ...

result:

ok correct

Subtask #4:

score: 20
Accepted

Test #16:

score: 20
Accepted
time: 14ms
memory: 3820kb

input:

1777 229

output:

891 1777 892 1776 882 1777 896 1776 878 1777 900 1776 874 1777 904 1776 870 1777 908 1776 866 1777 912 1776 862 1777 916 1776 858 1777 920 1776 854 1777 924 1776 850 1777 928 1776 846 1777 932 1776 842 1777 936 1776 838 1777 940 1776 834 1777 944 1776 830 1777 948 1776 826 1777 952 1776 822 1777 956...

result:

ok correct

Test #17:

score: 0
Accepted
time: 11ms
memory: 3628kb

input:

1129 229

output:

567 1129 568 1128 558 1129 572 1128 554 1129 576 1128 550 1129 580 1128 546 1129 584 1128 542 1129 588 1128 538 1129 592 1128 534 1129 596 1128 530 1129 600 1128 526 1129 604 1128 522 1129 608 1128 518 1129 612 1128 514 1129 616 1128 510 1129 620 1128 506 1129 624 1128 502 1129 628 1128 498 1129 632...

result:

ok correct

Test #18:

score: 0
Accepted
time: 39ms
memory: 3624kb

input:

4253 233

output:

2129 4253 2130 4252 2120 4253 2134 4252 2116 4253 2138 4252 2112 4253 2142 4252 2108 4253 2146 4252 2104 4253 2150 4252 2100 4253 2154 4252 2096 4253 2158 4252 2092 4253 2162 4252 2088 4253 2166 4252 2084 4253 2170 4252 2080 4253 2174 4252 2076 4253 2178 4252 2072 4253 2182 4252 2068 4253 2186 4252 ...

result:

ok correct

Test #19:

score: 0
Accepted
time: 23ms
memory: 3628kb

input:

2311 233

output:

1158 2311 1159 2310 1149 2311 1163 2310 1145 2311 1167 2310 1141 2311 1171 2310 1137 2311 1175 2310 1133 2311 1179 2310 1129 2311 1183 2310 1125 2311 1187 2310 1121 2311 1191 2310 1117 2311 1195 2310 1113 2311 1199 2310 1109 2311 1203 2310 1105 2311 1207 2310 1101 2311 1211 2310 1097 2311 1215 2310 ...

result:

ok correct

Test #20:

score: 0
Accepted
time: 24ms
memory: 3628kb

input:

6712 114

output:

3358 6712 3359 6711 3350 6712 3363 6711 3346 6712 3367 6711 3342 6712 3371 6711 3338 6712 3375 6711 3334 6712 3379 6711 3330 6712 3383 6711 3326 6712 3387 6711 3322 6712 3391 6711 3318 6712 3395 6711 3314 6712 3399 6711 3310 6712 3403 6711 3306 6712 3407 6711 3302 6712 3411 6711 3298 6712 3415 6711 ...

result:

ok correct

Test #21:

score: 0
Accepted
time: 5ms
memory: 3632kb

input:

1050 114

output:

527 1050 528 1049 519 1050 532 1049 515 1050 536 1049 511 1050 540 1049 507 1050 544 1049 503 1050 548 1049 499 1050 552 1049 495 1050 556 1049 491 1050 560 1049 487 1050 564 1049 483 1050 568 1049 479 1050 572 1049 475 1050 576 1049 471 1050 580 1049 467 1050 584 1049 463 1050 588 1049 459 1050 592...

result:

ok correct

Test #22:

score: 0
Accepted
time: 24ms
memory: 3864kb

input:

1132 514

output:

568 1132 569 1131 560 1132 573 1131 556 1132 577 1131 552 1132 581 1131 548 1132 585 1131 544 1132 589 1131 540 1132 593 1131 536 1132 597 1131 532 1132 601 1131 528 1132 605 1131 524 1132 609 1131 520 1132 613 1131 516 1132 617 1131 512 1132 621 1131 508 1132 625 1131 504 1132 629 1131 500 1132 633...

result:

ok correct

Test #23:

score: 0
Accepted
time: 17ms
memory: 3512kb

input:

1130 514

output:

567 1130 568 1129 559 1130 572 1129 555 1130 576 1129 551 1130 580 1129 547 1130 584 1129 543 1130 588 1129 539 1130 592 1129 535 1130 596 1129 531 1130 600 1129 527 1130 604 1129 523 1130 608 1129 519 1130 612 1129 515 1130 616 1129 511 1130 620 1129 507 1130 624 1129 503 1130 628 1129 499 1130 632...

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: 28ms
memory: 3604kb

input:

1151 564

output:

578 1151 579 1150 569 1151 583 1150 565 1151 587 1150 561 1151 591 1150 557 1151 595 1150 553 1151 599 1150 549 1151 603 1150 545 1151 607 1150 541 1151 611 1150 537 1151 615 1150 533 1151 619 1150 529 1151 623 1150 525 1151 627 1150 521 1151 631 1150 517 1151 635 1150 513 1151 639 1150 509 1151 643...

result:

ok correct

Test #25:

score: 0
Accepted
time: 22ms
memory: 3568kb

input:

1042 511

output:

523 1042 524 1041 515 1042 528 1041 511 1042 532 1041 507 1042 536 1041 503 1042 540 1041 499 1042 544 1041 495 1042 548 1041 491 1042 552 1041 487 1042 556 1041 483 1042 560 1041 479 1042 564 1041 475 1042 568 1041 471 1042 572 1041 467 1042 576 1041 463 1042 580 1041 459 1042 584 1041 455 1042 588...

result:

ok correct

Test #26:

score: 0
Accepted
time: 24ms
memory: 3636kb

input:

1170 575

output:

587 1170 588 1169 579 1170 592 1169 575 1170 596 1169 571 1170 600 1169 567 1170 604 1169 563 1170 608 1169 559 1170 612 1169 555 1170 616 1169 551 1170 620 1169 547 1170 624 1169 543 1170 628 1169 539 1170 632 1169 535 1170 636 1169 531 1170 640 1169 527 1170 644 1169 523 1170 648 1169 519 1170 652...

result:

ok correct

Test #27:

score: 0
Accepted
time: 28ms
memory: 3592kb

input:

1249 615

output:

627 1249 628 1248 618 1249 632 1248 614 1249 636 1248 610 1249 640 1248 606 1249 644 1248 602 1249 648 1248 598 1249 652 1248 594 1249 656 1248 590 1249 660 1248 586 1249 664 1248 582 1249 668 1248 578 1249 672 1248 574 1249 676 1248 570 1249 680 1248 566 1249 684 1248 562 1249 688 1248 558 1249 692...

result:

ok correct

Test #28:

score: 0
Accepted
time: 8ms
memory: 3572kb

input:

746 364

output:

375 746 376 745 367 746 380 745 363 746 384 745 359 746 388 745 355 746 392 745 351 746 396 745 347 746 400 745 343 746 404 745 339 746 408 745 335 746 412 745 331 746 416 745 327 746 420 745 323 746 424 745 319 746 428 745 315 746 432 745 311 746 436 745 307 746 440 745 303 746 444 745 299 746 448 ...

result:

ok correct

Test #29:

score: 0
Accepted
time: 27ms
memory: 3516kb

input:

1146 565

output:

575 1146 576 1145 567 1146 580 1145 563 1146 584 1145 559 1146 588 1145 555 1146 592 1145 551 1146 596 1145 547 1146 600 1145 543 1146 604 1145 539 1146 608 1145 535 1146 612 1145 531 1146 616 1145 527 1146 620 1145 523 1146 624 1145 519 1146 628 1145 515 1146 632 1145 511 1146 636 1145 507 1146 640...

result:

ok correct

Test #30:

score: 0
Accepted
time: 6ms
memory: 3632kb

input:

554 265

output:

279 554 280 553 271 554 284 553 267 554 288 553 263 554 292 553 259 554 296 553 255 554 300 553 251 554 304 553 247 554 308 553 243 554 312 553 239 554 316 553 235 554 320 553 231 554 324 553 227 554 328 553 223 554 332 553 219 554 336 553 215 554 340 553 211 554 344 553 207 554 348 553 203 554 352 ...

result:

ok correct

Test #31:

score: 0
Accepted
time: 23ms
memory: 3568kb

input:

1061 519

output:

533 1061 534 1060 524 1061 538 1060 520 1061 542 1060 516 1061 546 1060 512 1061 550 1060 508 1061 554 1060 504 1061 558 1060 500 1061 562 1060 496 1061 566 1060 492 1061 570 1060 488 1061 574 1060 484 1061 578 1060 480 1061 582 1060 476 1061 586 1060 472 1061 590 1060 468 1061 594 1060 464 1061 598...

result:

ok correct

Test #32:

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

input:

173 78

output:

89 173 90 172 80 173 94 172 76 173 98 172 72 173 102 172 68 173 106 172 64 173 110 172 60 173 114 172 56 173 118 172 52 173 122 172 48 173 126 172 44 173 130 172 40 173 134 172 36 173 138 172 32 173 142 172 28 173 146 172 24 173 150 172 20 173 154 172 16 173 158 172 12 173 162 172 171 2 90 1 91 173 ...

result:

ok correct

Test #33:

score: 0
Accepted
time: 12ms
memory: 3600kb

input:

884 430

output:

444 884 445 883 436 884 449 883 432 884 453 883 428 884 457 883 424 884 461 883 420 884 465 883 416 884 469 883 412 884 473 883 408 884 477 883 404 884 481 883 400 884 485 883 396 884 489 883 392 884 493 883 388 884 497 883 384 884 501 883 380 884 505 883 376 884 509 883 372 884 513 883 368 884 517 ...

result:

ok correct

Test #34:

score: 0
Accepted
time: 26ms
memory: 3512kb

input:

1089 537

output:

547 1089 548 1088 538 1089 552 1088 534 1089 556 1088 530 1089 560 1088 526 1089 564 1088 522 1089 568 1088 518 1089 572 1088 514 1089 576 1088 510 1089 580 1088 506 1089 584 1088 502 1089 588 1088 498 1089 592 1088 494 1089 596 1088 490 1089 600 1088 486 1089 604 1088 482 1089 608 1088 478 1089 612...

result:

ok correct

Test #35:

score: 0
Accepted
time: 4ms
memory: 3580kb

input:

433 207

output:

219 433 220 432 210 433 224 432 206 433 228 432 202 433 232 432 198 433 236 432 194 433 240 432 190 433 244 432 186 433 248 432 182 433 252 432 178 433 256 432 174 433 260 432 170 433 264 432 166 433 268 432 162 433 272 432 158 433 276 432 154 433 280 432 150 433 284 432 146 433 288 432 142 433 292 ...

result:

ok correct