QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#523356 | #8907. Конференция | jiamengtong | 5 | 22ms | 5984kb | C++14 | 1.2kb | 2024-08-18 09:08:45 | 2024-08-18 09:08:45 |
Judging History
answer
#include<bits/stdc++.h>
#define M 100005
using namespace std;
int n, seq[M], fl[M], nn[M];
struct node{
int l, r, id;
}a[M];
bool cmp(node x, node y)
{
if(x.r != y.r) return x.r < y.r;
return x.l < y.l;
}
void solve()
{
scanf("%d", &n);
memset(fl, 0, sizeof(fl));
for(int i = 1; i <= n; i++) scanf("%d%d", &a[i].l, &a[i].r), a[i].id = i;
sort(a + 1, a + n + 1, cmp);
// for(int i = 1; i <= n; i++) cout << a[i].l << " " << a[i].r << " " << a[i].id << endl;
int tot = 0;
int mxr = 0;
for(int i = 1; i <= n; i++) if(mxr < a[i].l) seq[++tot] = i, mxr = a[i].r, fl[i] = 1;
// cout << seq[tot / 2] << endl;
if(seq[tot / 2 + 1] >= n / 2)
{
for(int i = 1; i <= tot / 2; i++) printf("%d ", a[seq[i]].id);
for(int i = 1, num = 0; num < (n - tot) / 2; i++)
{
if(!fl[i]) printf("%d ", a[i].id), num++;
}
puts("");
}
else
{
for(int i = tot / 2 + 1; i <= tot; i++) printf("%d ", a[seq[i]].id);
// cout << "HELP\n" << fl[7] << '\n';
for(int i = seq[tot / 2 + 1], num = 0; num < (n - tot) / 2; i++)
{
if(!fl[i]) printf("%d ", a[i].id), num++;
}
puts("");
}
}
int main()
{
int T;
scanf("%d", &T);
while(T--) solve();
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: 4248kb
input:
1 4 823983109 859315505 510901709 589624124 351308325 413158126 29447781 138101981
output:
4 3
result:
ok answers are correct. (1 test case)
Test #2:
score: 5
Accepted
time: 1ms
memory: 5836kb
input:
1 10 344190293 385750493 951894838 978895800 82358344 338131819 540516504 607653166 820688970 951835774 395392706 419489159 623802732 644208366 798160348 818154082 680378878 682083538 467019518 519267671
output:
3 1 6 10 4
result:
ok answers are correct. (1 test case)
Test #3:
score: 5
Accepted
time: 1ms
memory: 5984kb
input:
1 500 943625790 945741848 367933677 368747115 117030592 118328257 321658393 322265356 413440931 413466704 191801051 192382494 45318188 45578563 184352813 184557169 267846012 270194842 787080743 789209469 102034755 102793278 677264139 679983858 858429750 858446103 879077624 879224701 573990877 574468...
output:
323 478 486 483 456 418 368 126 72 212 498 499 30 449 233 358 462 66 337 138 68 252 308 7 422 107 205 140 402 203 152 258 429 433 61 326 407 305 190 181 202 284 200 270 306 37 455 378 42 144 134 120 412 113 293 11 343 141 146 230 122 3 354 82 495 71 97 28 467 475 355 403 447 423 436 102 86 91 444 36...
result:
ok answers are correct. (1 test case)
Test #4:
score: 5
Accepted
time: 1ms
memory: 4204kb
input:
1 1000 724221604 725069540 143194275 144876990 944969667 945425601 692430254 692500244 413915365 415513016 441154319 441817251 397426964 397797495 573976568 574310166 333482080 333658815 692670858 693494033 781215754 781315542 297042073 297766151 347972954 348085089 567271813 567539623 43283944 4381...
output:
536 529 141 334 820 451 945 454 354 850 897 197 126 949 602 534 393 282 196 646 413 284 703 272 39 710 96 396 125 952 173 130 367 265 903 121 692 810 349 320 23 219 641 411 15 844 269 75 550 661 242 777 698 621 129 616 189 955 105 276 957 887 539 221 336 705 937 991 55 759 174 373 631 475 742 41 220...
result:
ok answers are correct. (1 test case)
Test #5:
score: 5
Accepted
time: 0ms
memory: 4352kb
input:
1 10000 1915 1916 6871 6872 12925 12926 12679 12680 18809 18810 4725 4726 12781 12782 6363 6364 18471 18472 17037 17038 13225 13226 12201 12202 8365 8366 11427 11428 2859 2860 18423 18424 3519 3520 14647 14648 17649 17650 11249 11250 9003 9004 15623 15624 11345 11346 457 458 4805 4806 17905 17906 84...
output:
4766 9608 8588 7970 4330 9042 4619 4019 1723 757 970 9509 337 91 3766 4462 9793 9109 860 5577 5179 195 7485 8534 3584 2915 4590 8995 4070 9081 1263 3916 4154 8800 8845 431 7355 6314 862 8463 3690 8332 4622 3145 2320 711 1148 3671 8729 5355 2896 2144 6869 6707 9908 1781 4853 6186 8683 4740 1049 607 3...
result:
ok answers are correct. (1 test case)
Test #6:
score: 5
Accepted
time: 0ms
memory: 4488kb
input:
1 10000 951623572 951627967 944693469 944698949 866936571 866953676 708414261 708441197 918925455 918994693 693014496 693052258 500076831 500117857 346961903 346994890 790230509 790247658 486707346 486907093 703108219 703186545 666115252 666249778 638756819 638771288 605550898 605661894 618156528 61...
output:
1837 2807 1955 6579 7554 6281 5488 969 3590 9148 6570 8567 280 2499 4882 8400 1338 6559 427 3961 5378 6589 4656 7420 197 3758 6452 3502 2556 8342 4209 3498 5293 6217 861 8639 7676 4264 3927 6756 1509 7028 7189 2333 6530 8154 6671 1528 7229 1723 1488 4628 8086 7560 7277 7793 7580 9558 9145 1051 2238 ...
result:
ok answers are correct. (1 test case)
Test #7:
score: 5
Accepted
time: 20ms
memory: 5744kb
input:
1 100000 95477550 95482342 57260360 57270968 324158435 324161602 337960344 337966333 843677712 843688311 61482892 61483547 494172231 494182559 843751785 843754290 158705730 158714372 136974660 136976009 424424906 424425379 802041471 802042132 670649961 670659516 155724598 155724784 245837370 2458388...
output:
71939 99928 86010 22766 47721 66161 24469 20566 99568 6269 93234 45127 5007 29782 9053 25180 12136 64304 84962 81419 66887 58844 76589 34741 133 84150 2327 14810 67578 84023 79006 36899 55583 62141 9538 53071 15503 29124 31836 36145 98044 62689 45609 96058 71646 96895 75087 46761 79850 89193 98612 9...
result:
ok answers are correct. (1 test case)
Test #8:
score: 5
Accepted
time: 22ms
memory: 5800kb
input:
1 100000 126151 126152 147685 147686 168691 168692 124505 124506 58489 58490 98015 98016 173339 173340 39469 39470 135733 135734 53105 53106 118229 118230 46503 46504 36953 36954 185819 185820 27699 27700 64063 64064 60847 60848 18307 18308 1697 1698 109113 109114 99305 99306 72117 72118 107975 1079...
output:
75377 51260 37869 20294 14965 95874 5667 11492 31580 717 17389 44033 71923 88665 87417 92824 48939 36551 94330 82375 3013 5157 98708 5429 56464 64915 79502 42666 95763 19728 57214 90790 52810 50976 8996 33863 42096 24445 92194 61911 74140 40171 77799 94597 63531 25724 59373 39922 1130 73597 70370 28...
result:
ok answers are correct. (1 test case)
Subtask #2:
score: 0
Wrong Answer
Test #9:
score: 0
Wrong Answer
time: 1ms
memory: 4376kb
input:
1 10 4 6 15 20 1 12 11 16 3 10 13 19 5 18 7 8 2 17 9 14
output:
1 8 5 3 4
result:
wrong answer answer size for input: 4, answer size in participant solution: 3 (test case 1)
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Test #39:
score: 15
Accepted
time: 1ms
memory: 4328kb
input:
1 10 8 9 15 18 12 13 5 14 7 10 1 20 2 19 6 11 3 4 16 17
output:
9 1 5 8 4
result:
ok answers are correct. (1 test case)
Test #40:
score: 15
Accepted
time: 1ms
memory: 4312kb
input:
1 100 152 159 63 64 101 102 105 106 90 175 114 173 181 190 37 44 186 189 126 127 135 138 27 34 136 137 76 77 149 164 129 130 17 18 68 71 66 73 11 12 47 48 67 72 49 54 21 22 118 121 3 4 117 170 83 194 91 112 124 133 139 140 85 88 151 162 86 87 84 89 116 171 30 31 6 9 46 195 92 97 14 15 125 132 39 42 ...
output:
34 61 3 4 89 98 10 16 13 31 81 56 73 47 92 55 78 67 32 35 44 40 94 76 77 64 58 29 25 54 42 30 11 52 45 1 33 88 15 91 65 48 46 100 27 36 68 6 72 5
result:
ok answers are correct. (1 test case)
Test #41:
score: 15
Accepted
time: 1ms
memory: 4316kb
input:
1 100 192 193 83 84 38 39 33 34 120 121 19 20 118 119 175 176 13 14 74 75 154 155 101 102 68 69 146 147 81 82 89 90 53 54 190 191 181 182 48 49 139 140 40 41 72 73 116 117 1 200 124 125 4 145 9 50 150 151 112 113 27 28 122 123 5 126 46 47 152 153 29 30 91 92 25 26 188 189 110 111 104 105 11 12 179 1...
output:
42 9 62 44 6 89 45 38 31 36 49 4 75 3 22 60 84 34 20 66 17 55 69 73 52 72 88 13 99 23 10 93 67 15 2 80 70 16 37 82 98 86 81 12 41 57 28 50 46 58
result:
ok answers are correct. (1 test case)
Test #42:
score: 15
Accepted
time: 1ms
memory: 4240kb
input:
1 100 189264773 692317517 166821159 730826701 132093661 747760156 244413340 258044743 425913239 571468467 345436794 608324228 414722760 580844232 4880692 979509087 381662564 593964118 15895639 957413704 17946557 939078604 73528693 867087267 18964638 919816261 39059497 884193691 278085494 635574530 2...
output:
95 53 28 96 52 47 78 25 64 41 72 46 71 5 7 63 79 9 54 33 29 99 82 6 55 87 49 89 27 20 15 35 88 97 85 16 37 94 93 19 60 1 69 83 90 76 30 2 50 98
result:
ok answers are correct. (1 test case)
Test #43:
score: 15
Accepted
time: 0ms
memory: 4364kb
input:
1 100 327645749 329093539 980227412 994005154 579806213 598354521 898396499 898525148 545535670 547099732 57665434 63966759 91822376 112410483 898974428 932154782 174406471 268197958 272306427 273971634 389680998 390221315 3154994 997314160 269858259 282937852 343400516 407809409 620512844 631492929...
output:
5 59 24 3 15 36 58 74 70 29 71 57 67 69 97 83 99 78 95 4 65 76 86 63 47 61 23 39 81 32 53 80 46 40 98 88 49 96 17 18 72 77 82 41 25 8 22 42 89 2
result:
ok answers are correct. (1 test case)
Test #44:
score: 15
Accepted
time: 0ms
memory: 4248kb
input:
1 100 19022424 295717821 521909470 631285980 497332842 642316879 652870043 654095607 1416391 996731107 325050618 333648846 854687185 897107660 53041861 61991654 182273029 231298999 38904128 236257569 307694478 357691523 579993158 583091697 239954119 244805531 434287435 485536294 225429937 226370246 ...
output:
61 39 66 68 93 82 87 15 51 13 48 25 6 74 29 99 88 80 36 20 8 71 33 70 42 52 19 41 16 62 26 18 9 10 45 31 32 60 97 37 53 1 76 11 69 77 24 58 14 55
result:
ok answers are correct. (1 test case)
Test #45:
score: 15
Accepted
time: 1ms
memory: 4256kb
input:
1 500 689426082 689507542 427389970 430516694 305033996 305649163 125494668 126279290 235974559 238575143 113585036 123617477 809213065 811464735 695392709 697437354 44577991 45927754 356984995 358581387 853780607 858598288 494073918 494101939 531949799 532852851 910230931 912010323 496284517 500744...
output:
186 252 97 430 495 13 245 71 259 207 46 116 197 93 419 251 409 272 231 388 161 458 390 447 368 303 333 374 456 304 295 151 440 313 286 310 81 1 297 8 246 83 44 126 372 240 226 361 216 457 72 61 95 102 86 55 340 262 271 248 238 7 74 37 154 451 159 281 434 23 84 163 182 52 336 323 98 255 342 261 70 10...
result:
ok answers are correct. (1 test case)
Test #46:
score: 15
Accepted
time: 0ms
memory: 4380kb
input:
1 500 298167304 298463628 791031018 794720207 659273641 659882121 104798428 105261813 211419472 211890862 743609251 750342623 785451379 825218182 161739521 165868601 668366592 670883708 17846664 980939732 623757216 629418838 57011271 280805195 702352076 702445129 242115912 248568730 392104305 412710...
output:
477 75 28 217 246 328 434 176 428 365 216 468 121 243 90 437 4 196 288 361 342 263 419 282 24 174 258 278 438 132 488 119 373 413 5 244 417 211 366 376 306 225 14 95 346 340 256 398 445 74 59 386 254 64 377 479 493 126 92 472 439 360 155 442 291 416 492 353 151 94 347 203 496 169 397 497 331 26 40 4...
result:
ok answers are correct. (1 test case)
Test #47:
score: 15
Accepted
time: 1ms
memory: 4328kb
input:
10 60 11164929 994881562 299556408 474028014 66299485 119766199 432871164 460158656 132161383 176718496 271951527 606038754 539359133 553976140 949470174 958412706 661828987 994881562 12788677 49941342 891211584 895712102 724455378 983161900 152648130 160372649 225338436 227986635 949470174 97419152...
output:
7 52 57 21 55 23 39 59 50 29 53 46 58 45 26 6 31 36 30 43 32 16 20 48 11 8 54 15 33 27 7 13 2 11 10 3 5 12 2 3 45 65 9 73 88 100 10 61 21 57 7 59 48 43 82 84 28 63 38 64 44 94 93 18 13 40 36 62 92 24 96 22 32 42 68 6 58 95 31 30 87 70 19 4 23 85 39 66 72 74 36 59 86 40 71 79 83 73 27 58 105 87 1...
result:
ok answers are correct. (10 test cases)
Test #48:
score: 15
Accepted
time: 1ms
memory: 4196kb
input:
1 500 816410380 822544531 933258032 939742925 916278797 958637658 231564956 282306172 702316904 703490950 630478476 632740217 622841133 628258870 559790060 573154940 767361234 767671613 284287915 872329108 294087713 295464162 495885666 857329063 350544956 354873942 83065442 92337813 689858265 846165...
output:
483 343 470 389 155 356 77 449 185 193 246 105 143 203 353 490 314 81 418 308 208 302 327 481 64 282 459 319 119 270 374 362 238 20 121 300 260 360 397 313 160 326 115 372 62 76 5 491 293 458 489 116 134 415 137 446 188 438 164 9 274 236 487 54 168 359 365 271 286 112 18 465 349 256 421 83 463 156 6...
result:
ok answers are correct. (1 test case)
Test #49:
score: 0
Wrong Answer
time: 1ms
memory: 4192kb
input:
10 128 522815246 524621300 923118423 925373805 263423265 265533002 822971542 824137800 862520556 870374525 963957423 987999676 621804380 629749739 353037672 356131731 583538841 596361306 437833985 448432601 583372381 765623200 136738523 153836821 540525609 540914706 211359946 332668957 249110665 318...
output:
102 37 1 13 56 89 76 28 124 103 58 60 75 43 100 45 110 53 36 84 71 5 122 31 32 29 96 2 79 51 115 21 123 61 107 74 95 120 67 9 7 91 119 33 86 22 106 78 42 17 68 77 11 108 62 4 98 73 125 41 20 121 101 34 23 17 10 11 7 4 20 8 22 21 16 6 30 63 26 46 23 18 2 25 59 62 4 1 48 32 31 53 61 64 51 50 29 66 1...
result:
wrong answer answer size for input: 20, answer size in participant solution: 11 (test case 9)
Subtask #5:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #2:
0%
Subtask #7:
score: 0
Skipped
Dependency #2:
0%
Subtask #8:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%