QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#524627 | #8907. Конференция | Ayaya | 32 | 16ms | 9412kb | C++14 | 2.6kb | 2024-08-19 21:28:13 | 2024-08-19 21:28:14 |
Judging History
answer
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<unordered_map>
#include<vector>
#include<bitset>
#include<queue>
#include<set>
#include<map>
#include<ctime>
#include<random>
#include<numeric>
#include<assert.h>
using namespace std;
#define int long long
#define ll long long
#define ull unsigned long long
#define lc (x<<1)
#define rc (x<<1|1)
#define pii pair<int,int>
#define mkp make_pair
#define fi first
#define se second
const int Mx=500005,p=998244353;
int read(){
char ch=getchar();
int Alice=0,Aya=1;
while(ch<'0'||ch>'9'){
if(ch=='-') Aya=-Aya;
ch=getchar();
}
while(ch>='0'&&ch<='9')
Alice=(Alice<<3)+(Alice<<1)+(ch^48),ch=getchar();
return (Aya==1?Alice:-Alice);
}
int n;
struct Seg{
int l,r,id;
bool operator <(const Seg&obj)const{
return r<obj.r;
}
}a[Mx];
bool Inter(int L,int R,int l,int r){
if(l<L) swap(L,l),swap(R,r);
if(l<=R) return 1;
else return 0;
}
int Check(vector<int>res){
int maxR=0,ans=0;
//cout<<"-------------\n";
for(int id:res){
//cout<<a[id].l<<" "<<a[id].r<<" : "<<a[id].id;
if(a[id].l>maxR) maxR=a[id].r,ans++;//,cout<<"*";
//cout<<endl;
}
return ans;
}
mt19937 rd(time(0));
uniform_int_distribution<int>dist(1,100000000);
void Solve(){
n=read();
for(int i=1;i<=n;i++){
a[i].l=read(),a[i].r=read(),a[i].id=i;
}
sort(a+1,a+n+1);
int maxR=0,ans=0;
vector<int>chos;
for(int i=1;i<=n;i++){
//cout<<a[i].l<<' '<<a[i].r<<endl;
if(a[i].l>maxR) maxR=a[i].r,ans++,chos.push_back(i);
}
//cout<<ans<<endl;
ans>>=1;
//cout<<ans<<endl;
for(int i=0;i+ans-1<(int)chos.size();i++){
int L=a[chos[i]].l,R=a[chos[i+ans-1]].r,cnt=0;
for(int j=chos[i];j<=n;j++){
int l=a[j].l,r=a[j].r;
if(Inter(L,R,l,r)) cnt++;
}
if(cnt<n/2) continue;
//cout<<L<<" - "<<R<<endl;
vector<int>res,Res;
res.push_back(a[chos[i]].id);
Res.push_back(chos[i]);
if(ans!=1) res.push_back(a[chos[i+ans-1]].id),Res.push_back(chos[i+ans-1]);
for(int j=chos[i];j<=n;j++){
if(j==chos[i]||j==chos[i+ans-1]) continue;
int l=a[j].l,r=a[j].r;
if(Inter(L,R,l,r)&&(int)res.size()*2<n){
res.push_back(a[j].id);
Res.push_back(j);
}
}
sort(Res.begin(),Res.end());
if(Check(Res)!=ans){
// cout<<Check(Res)<<endl;
// while(1);
continue;
}
for(int id:res) printf("%lld ",id);
puts("");
return;
}
while(1);
}
signed main(){
int T=read();
while(T--) Solve();
return 0;
}
/*
Hello!!
Sample:
1
10
1 4
2 12
9 16
6 16
13 16
2 16
1 18
14 18
5 19
5 19
-------------------
*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 0ms
memory: 3864kb
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: 0ms
memory: 4064kb
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 4 1 6 10
result:
ok answers are correct. (1 test case)
Test #3:
score: 5
Accepted
time: 1ms
memory: 3804kb
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 193 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 44...
result:
ok answers are correct. (1 test case)
Test #4:
score: 5
Accepted
time: 1ms
memory: 3916kb
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 183 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...
result:
ok answers are correct. (1 test case)
Test #5:
score: 5
Accepted
time: 2ms
memory: 4156kb
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 3868 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 ...
result:
ok answers are correct. (1 test case)
Test #6:
score: 5
Accepted
time: 2ms
memory: 4364kb
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 2623 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 ...
result:
ok answers are correct. (1 test case)
Test #7:
score: 5
Accepted
time: 13ms
memory: 8096kb
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 26350 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 9...
result:
ok answers are correct. (1 test case)
Test #8:
score: 5
Accepted
time: 16ms
memory: 9412kb
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 93238 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 70...
result:
ok answers are correct. (1 test case)
Subtask #2:
score: 20
Accepted
Test #9:
score: 20
Accepted
time: 0ms
memory: 3860kb
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 9
result:
ok answers are correct. (1 test case)
Test #10:
score: 20
Accepted
time: 0ms
memory: 3864kb
input:
1 10 117956745 973823632 23571766 719701618 38785378 558526309 231187237 674007540 733362426 831144169 89816954 851213129 249341944 612792325 373425880 852493895 483542387 985564497 696597340 810358170
output:
3 7 4 2 6
result:
ok answers are correct. (1 test case)
Test #11:
score: 20
Accepted
time: 0ms
memory: 3868kb
input:
1 14 16686983 932034450 223405271 642058261 317002236 708563919 199994594 587702670 454769448 522126055 746578284 809511289 133298121 894605432 94273255 452589074 5923134 643331337 350619519 385885046 317742836 915325929 320415015 743405145 48507375 963122902 124278107 221614208
output:
14 10 8 4 2 9 3
result:
ok answers are correct. (1 test case)
Test #12:
score: 20
Accepted
time: 0ms
memory: 4068kb
input:
1 16 100212181 610959822 59569481 946341427 168724782 490902631 156501761 504380971 25798133 52287573 318331091 915496014 208509217 366012539 288068792 715557962 256907803 526058782 50050253 126428948 104145448 301925232 146518183 863900618 639034909 804627990 412452373 490792746 108316345 249279177...
output:
5 15 10 16 11 7 3 4
result:
ok answers are correct. (1 test case)
Test #13:
score: 20
Accepted
time: 0ms
memory: 3772kb
input:
1 20 456674597 608693437 109249158 596412179 370495893 870389856 488084264 934790215 442774596 811747447 872496853 921725870 376801154 471157541 845813365 998784402 228965099 809754209 382052625 391934909 259367607 683974291 670301847 878762117 35222309 784937368 185199365 910293412 413659466 752376...
output:
18 10 7 19 2 11 16 13 9 3
result:
ok answers are correct. (1 test case)
Test #14:
score: 20
Accepted
time: 1ms
memory: 6180kb
input:
1 20 297037250 419041198 282321805 321064650 349747242 362433069 351288380 375542434 419041198 445887196 602441780 958674622 241096289 375542434 475310449 592319891 349747242 913534896 383581240 419041198 173682409 328216346 328216346 603578694 472233867 801490971 95678652 168142402 168373452 387862...
output:
14 3 16 2 11 19 7 4 20 15
result:
ok answers are correct. (1 test case)
Test #15:
score: 20
Accepted
time: 0ms
memory: 3776kb
input:
1 20 414632002 543806183 925805922 929091516 635760918 935185417 363667984 414632002 367022099 862453723 417689885 547896642 134334204 417689885 65069763 927973748 547896642 882308193 65069763 781505290 263762476 560812886 559742181 929091516 134334204 547896642 547896642 589976615 110485699 9290915...
output:
17 18 4 7 1 20 6 13 11 10
result:
ok answers are correct. (1 test case)
Test #16:
score: 20
Accepted
time: 0ms
memory: 3864kb
input:
1 20 329453252 360742558 89402460 286183994 89402460 360742558 89402460 855784898 286183994 360742558 731929589 996880390 947477154 996880390 286183994 329453252 886845999 947477154 947477154 996880390 855784898 886845999 855784898 947477154 360742558 996880390 329453252 360742558 89402460 360742558...
output:
2 1 20 8 5 19 15 14 3 16
result:
ok answers are correct. (1 test case)
Test #17:
score: 20
Accepted
time: 0ms
memory: 3780kb
input:
1 18 202540904 389043517 226910816 248116434 63938984 546305677 140915764 499772247 49838487 549773488 447779853 755008234 533058173 810427590 285195967 754382401 637925690 745236874 124462413 429325871 337679536 747589476 524818542 789436305 99818393 333713311 365323277 797802647 621572224 86322465...
output:
2 16 13 1 10 4 3 5 17
result:
ok answers are correct. (1 test case)
Test #18:
score: 20
Accepted
time: 0ms
memory: 4064kb
input:
1 20 5 29 3 26 28 32 16 37 30 31 9 18 12 40 20 39 24 34 8 23 2 15 10 11 7 13 14 38 1 27 17 36 22 35 25 33 4 21 6 19
output:
12 13 11 6 20 19 10 2 15 1
result:
ok answers are correct. (1 test case)
Test #19:
score: 20
Accepted
time: 0ms
memory: 3776kb
input:
1 20 485722088 852895392 180584674 212943100 66284389 595168707 2136725 669530231 56269137 678699628 320676083 957135819 596929135 788062700 124202451 346702760 302036371 939376831 39652702 316659144 561860366 877505895 290483397 969059389 256661759 825834533 7051957 255090916 25578269 614441405 579...
output:
2 14 10 20 8 3 15 16 4 5
result:
ok answers are correct. (1 test case)
Test #20:
score: 20
Accepted
time: 0ms
memory: 3780kb
input:
1 20 377259628 382099996 69472389 220349448 393265432 765479011 294596292 404572923 118284478 181270154 643688338 650238709 746999817 921253559 714973742 936522293 692298392 935037128 6892369 351174639 279506178 445398706 527519195 833951836 770865464 927351496 76532474 294108433 263985397 436457230...
output:
5 1 2 17 14 10 4 15 11 16
result:
ok answers are correct. (1 test case)
Test #21:
score: 20
Accepted
time: 0ms
memory: 4032kb
input:
1 20 422854059 481170824 437404694 545549659 104747483 235762834 26069209 210102693 247195443 329574823 668050357 676060905 666824938 742513110 800843882 976578863 485027093 574722004 112136604 121743796 22030602 122637670 569273785 573750615 569699277 573736325 725853453 854844997 647010820 7594164...
output:
10 19 11 4 3 5 20 16 18 1
result:
ok answers are correct. (1 test case)
Subtask #3:
score: 7
Accepted
Dependency #2:
100%
Accepted
Test #22:
score: 7
Accepted
time: 0ms
memory: 3732kb
input:
1 20 12 32 19 33 17 37 6 25 10 18 1 13 2 36 9 27 21 34 26 40 22 31 7 23 20 29 4 35 15 28 8 39 24 30 5 38 3 16 11 14
output:
6 20 19 5 12 4 8 1 14 7
result:
ok answers are correct. (1 test case)
Test #23:
score: 7
Accepted
time: 0ms
memory: 3728kb
input:
1 22 562112285 905647327 240141164 731142048 673886690 763757368 53498001 455662841 20676639 351849824 430638704 607091437 753698264 785733256 566785053 810160249 238350738 873040384 240965920 490240565 199338019 872579030 431913792 892894696 220531515 542988872 192378877 626707752 139188962 5219923...
output:
21 10 5 17 4 15 13 6 14 2 16
result:
ok answers are correct. (1 test case)
Test #24:
score: 7
Accepted
time: 0ms
memory: 3800kb
input:
1 24 452928043 647099793 130630202 367129866 17801368 222353883 39391651 651841181 233638785 667532265 395147159 960230719 588063665 826022795 690973714 857087461 271215960 970029927 552273808 753441132 44593615 602323775 302809042 318322155 177023370 935209668 69416623 749213040 399332295 627145871...
output:
3 12 16 2 17 24 11 4 5 18 14 19
result:
ok answers are correct. (1 test case)
Test #25:
score: 7
Accepted
time: 0ms
memory: 3876kb
input:
1 26 578589417 612484309 292504170 427700804 36277123 499735859 356607648 422009346 754570226 958096037 528029966 993720497 132792333 905159403 29838574 838444239 110735119 836548961 151753757 191748697 89804957 530886628 123919627 829686347 223709236 969746156 346126428 922783233 247235962 60749218...
output:
10 22 21 4 2 3 11 20 17 15 23 18 12
result:
ok answers are correct. (1 test case)
Test #26:
score: 7
Accepted
time: 0ms
memory: 3860kb
input:
1 30 14 29 10 26 4 51 17 52 12 53 36 49 23 58 33 35 2 42 31 44 11 54 6 56 8 60 13 55 46 50 27 47 30 37 24 38 9 48 3 59 22 45 18 28 20 41 7 16 5 57 25 39 34 40 32 43 1 15 19 21
output:
29 30 24 2 22 1 23 9 19 3 4 5 11 14 12
result:
ok answers are correct. (1 test case)
Test #27:
score: 7
Accepted
time: 0ms
memory: 4028kb
input:
1 30 629064809 641790958 578210607 887578641 490629251 577473081 71417170 624625927 160709442 194892241 578210607 831623663 372922675 624146119 608268161 731260920 301807640 578210607 578658807 923868223 228258154 723688277 395587126 726515177 235831812 737833555 368551495 509492097 65945142 3018076...
output:
5 24 15 14 18 3 9 7 4 30 29 26 11 12 22
result:
ok answers are correct. (1 test case)
Test #28:
score: 7
Accepted
time: 0ms
memory: 3780kb
input:
1 30 137296542 821961036 297866317 378867592 73619484 962698330 135824878 474909542 103746039 809367943 91070563 358316534 674622994 962698330 827032540 937136300 135824878 426692572 135824878 474909542 135824878 890103199 135824878 297866317 821961036 962698330 193440379 474909542 7897872 359386284...
output:
28 20 12 6 15 2 9 4 10 14 21 24 18 16 25
result:
ok answers are correct. (1 test case)
Test #29:
score: 7
Accepted
time: 0ms
memory: 3728kb
input:
1 30 29056738 742866412 710261289 995644753 17093202 785360586 474677840 710261289 432334306 742866412 432334306 710261289 417496758 742866412 74049239 417496758 29056738 742866412 544481373 710261289 710261289 742866412 474677840 544481373 17093202 710261289 710261289 995644753 742866412 785360586 ...
output:
18 26 22 29 8 23 17 12 28 4 6 13 1 9 7
result:
ok answers are correct. (1 test case)
Test #30:
score: 7
Accepted
time: 0ms
memory: 3804kb
input:
1 28 49272181 348875502 274336414 284183201 243949834 321672541 736652518 743848105 652730031 824864041 655956258 981360531 476791795 991304198 555269153 999500943 105391657 313308327 370064150 815695166 378968910 745237226 183138856 545120201 132232745 334725524 17861758 589929897 591371637 8537635...
output:
2 9 3 13 1 24 28 18 12 14 26 16 17 27
result:
ok answers are correct. (1 test case)
Test #31:
score: 7
Accepted
time: 0ms
memory: 3776kb
input:
1 30 26 49 35 53 8 39 18 52 13 36 41 48 21 47 2 42 27 55 1 17 40 57 29 59 3 24 37 58 5 33 31 50 10 30 23 60 44 51 15 16 7 38 22 56 4 43 9 25 45 46 12 32 20 54 11 19 6 34 14 28
output:
20 10 28 13 24 30 17 26 15 29 5 21 3 8 23
result:
ok answers are correct. (1 test case)
Test #32:
score: 7
Accepted
time: 0ms
memory: 3864kb
input:
1 30 656834254 888876375 591479951 877053255 230228279 500450410 673720061 912398603 156784707 638174529 102931874 286701668 407947838 905691072 232788839 626151375 77434657 356507836 308940877 834743633 28340621 257708354 480408641 791920983 162713038 357816015 388418446 805038965 19384463 36372925...
output:
22 11 6 9 13 15 30 27 3 29 26 8 5 24 16
result:
ok answers are correct. (1 test case)
Test #33:
score: 7
Accepted
time: 0ms
memory: 3804kb
input:
1 30 276117459 358757893 242147303 417349470 431645945 887019853 270969554 462457681 191873909 663638848 64891524 520763854 488015475 971478723 45208076 403655463 481207107 995401090 640172211 964152357 610798701 732006426 261032641 513928685 92712032 453273578 403670398 822282313 297578639 30164579...
output:
15 1 8 2 13 4 20 29 12 6 19 22 23 25 5
result:
ok answers are correct. (1 test case)
Test #34:
score: 7
Accepted
time: 0ms
memory: 3780kb
input:
1 30 698059820 704032697 813000350 985625673 279308122 623741768 533055871 928549206 47426516 281322666 275842816 519877101 347209442 692600482 863267459 953456649 597668272 889664266 915266074 990661703 24104409 318025559 438147041 438194531 415942415 452749986 163177173 454645219 170248307 6699798...
output:
26 12 29 18 5 22 19 11 24 13 14 6 27 3 15
result:
ok answers are correct. (1 test case)
Test #35:
score: 7
Accepted
time: 0ms
memory: 3804kb
input:
1 30 38778664 266974365 659342514 788316831 105309375 333335436 452687953 645271610 866451541 992350992 898020150 956487258 169300311 196487175 533003687 573730620 803830603 870313203 535272663 553927386 343001847 515742367 370406694 375080026 775445533 884774900 637980096 686706696 124970019 278074...
output:
7 10 1 15 3 24 12 23 19 17 11 8 18 4 27
result:
ok answers are correct. (1 test case)
Test #36:
score: 7
Accepted
time: 0ms
memory: 3808kb
input:
1 30 22689160 598699948 57997602 585516573 47716839 297491726 268634895 898651606 350127494 847430932 471441466 908283960 641576778 892852432 155293607 416552693 666482426 974822483 475979801 849556959 257889658 791152131 100583109 336068373 744476994 754219844 506091016 944210840 8450000 679157874 ...
output:
22 23 3 12 26 19 8 30 28 2 1 25 16 15 21
result:
ok answers are correct. (1 test case)
Test #37:
score: 7
Accepted
time: 0ms
memory: 3732kb
input:
1 30 37 46 23 45 16 21 14 53 32 50 13 40 22 55 11 47 8 33 6 18 7 34 36 52 15 20 29 54 38 49 4 25 5 30 9 59 12 42 26 57 31 51 1 27 17 60 10 56 3 41 24 43 19 44 2 28 35 58 39 48
output:
10 13 3 16 22 28 17 9 11 6 25 19 8 4 24
result:
ok answers are correct. (1 test case)
Test #38:
score: 7
Accepted
time: 0ms
memory: 3800kb
input:
1 30 401489547 725967637 220995091 918993330 167099370 624016129 460962645 787451589 105387235 340924306 213790135 850372211 160669266 390811067 133265130 544081104 647373796 708638034 410069343 909108707 200634433 832039652 109424048 427867478 167768155 451386654 654366706 718678090 578151378 66362...
output:
5 7 12 13 8 21 26 3 17 23 22 20 11 6 18
result:
ok answers are correct. (1 test case)
Subtask #4:
score: 0
Time Limit Exceeded
Test #39:
score: 15
Accepted
time: 0ms
memory: 3840kb
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: 0ms
memory: 3776kb
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:
41 3 17 24 87 84 60 37 93 85 12 86 90 62 43 57 8 21 63 80 23 51 71 69 2 66 18 22 19 14 97 75 49 95 70 34 32 35 61 44 40 77 64 58 29 5 28 39 74 79
result:
ok answers are correct. (1 test case)
Test #41:
score: 15
Accepted
time: 0ms
memory: 3804kb
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 41 9 62 44 6 89 45 38 31 36 49 4 57 75 3 22 60 84 34 20 28 66 17 55 69 73 52 72 88 50 13 99 23 10 93 46 67 15 2 80 70 16 37 82 98 86 81 12 58
result:
ok answers are correct. (1 test case)
Test #42:
score: 15
Accepted
time: 0ms
memory: 3864kb
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:
36 38 4 22 43 51 73 40 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 81 24 70 3 44 48 56 65 42 21 61 39 17 58
result:
ok answers are correct. (1 test case)
Test #43:
score: 15
Accepted
time: 0ms
memory: 3776kb
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:
6 93 28 31 62 35 84 7 27 43 56 37 92 16 34 68 94 85 51 48 64 9 10 13 52 55 54 73 1 44 87 50 20 26 30 90 66 38 11 100 14 91 75 60 45 79 21 19 96 18
result:
ok answers are correct. (1 test case)
Test #44:
score: 15
Accepted
time: 0ms
memory: 3784kb
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 20 8 39 71 66 33 70 68 42 93 52 19 82 41 87 16 62 26 15 18 9 10 51 13 45 48 31 32 60 97 37 25 53 1 6 74 76 11 29 69 99 88 77 24 80 58 14 55 36
result:
ok answers are correct. (1 test case)
Test #45:
score: 15
Accepted
time: 0ms
memory: 3860kb
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:
287 399 156 235 103 354 107 28 241 112 78 432 234 428 288 58 203 479 449 459 9 477 435 350 50 341 318 41 174 101 120 249 59 284 439 351 486 204 77 178 123 202 39 172 317 189 201 416 327 464 239 206 356 227 66 396 408 6 371 4 385 209 173 187 40 485 476 315 236 311 171 302 473 167 220 196 375 309 490 ...
result:
ok answers are correct. (1 test case)
Test #46:
score: 15
Accepted
time: 1ms
memory: 3824kb
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:
493 91 87 126 454 271 55 92 425 472 133 130 439 360 155 442 480 139 289 356 368 63 27 450 291 45 239 100 416 19 492 353 151 371 134 287 94 43 347 401 487 298 408 203 238 400 15 137 236 327 426 496 482 418 303 381 169 397 460 497 467 350 364 331 26 250 40 48 231 272 322 120 415 462 46 212 122 86 455 ...
result:
ok answers are correct. (1 test case)
Test #47:
score: 15
Accepted
time: 0ms
memory: 4144kb
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:
10 51 42 3 35 40 60 13 18 5 28 19 41 44 14 37 22 56 38 25 47 49 4 24 2 17 26 6 31 36 8 16 9 15 1 4 6 14 2 3 90 45 12 86 47 14 54 27 50 99 83 25 81 37 60 89 34 69 41 46 53 2 29 98 55 33 15 5 79 17 8 91 97 3 77 52 35 16 20 26 76 56 1 75 44 94 93 40 92 24 96 75 1 89 76 32 46 117 91 60 52 92 110 29 ...
result:
ok answers are correct. (10 test cases)
Test #48:
score: 15
Accepted
time: 0ms
memory: 4080kb
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:
130 105 454 220 500 427 107 428 125 417 468 123 70 229 194 154 267 414 14 230 416 191 424 182 494 442 276 26 80 241 103 27 420 183 448 138 212 129 21 391 288 280 56 197 57 169 477 40 480 328 453 462 136 198 472 284 228 350 181 248 352 192 111 401 200 117 316 381 498 36 305 189 340 358 351 474 223 20...
result:
ok answers are correct. (1 test case)
Test #49:
score: 15
Accepted
time: 0ms
memory: 4068kb
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:
116 76 25 12 117 63 92 128 70 18 127 48 30 111 46 52 3 27 16 66 64 83 105 69 15 94 14 112 87 8 88 38 109 44 114 35 24 59 82 85 19 26 10 97 126 23 54 102 61 107 37 74 1 13 95 56 89 120 67 9 11 62 73 80 23 20 8 17 10 22 11 21 7 16 4 6 35 40 52 15 3 49 58 43 22 24 20 34 8 6 41 11 55 33 39 28 12 45 19...
result:
ok answers are correct. (10 test cases)
Test #50:
score: 15
Accepted
time: 0ms
memory: 3800kb
input:
1 500 385 386 233 683 460 599 563 565 299 301 336 337 619 620 181 194 642 643 448 600 673 675 449 450 512 513 479 480 653 654 129 145 246 252 22 24 236 238 179 194 523 524 175 214 312 318 338 339 105 107 159 216 538 541 522 525 116 120 499 500 313 315 239 682 402 406 437 439 136 144 520 521 270 271 ...
output:
207 6 164 116 483 220 280 398 43 270 388 311 205 40 448 18 142 426 384 320 260 468 360 155 138 327 305 210 62 74 321 45 447 227 108 488 129 56 38 158 387 349 433 217 88 200 172 278 151 420 298 494 115 144 303 85 112 361 289 121 189 165 412 117 25 284 353 451 478 304 495 123 29 348 167 391 338 274 33...
result:
ok answers are correct. (1 test case)
Test #51:
score: 15
Accepted
time: 0ms
memory: 3888kb
input:
1 500 148231886 843751205 617312422 619924046 398704174 662992586 441434589 621116735 390950133 669928473 92679348 907367206 518370794 521942633 477434538 596304707 412430957 653183253 13886794 989938123 285865332 753481093 419812510 646087325 133532754 865082667 29746787 974186362 59429239 94867990...
output:
235 395 434 182 70 210 317 141 232 149 469 359 401 234 284 413 428 470 427 319 388 412 474 146 124 306 236 421 473 17 355 487 231 490 176 282 92 391 190 435 108 360 312 409 296 4 277 131 99 377 335 332 79 320 373 387 203 476 111 154 389 194 12 480 103 133 316 128 278 9 292 386 69 368 43 189 22 352 3...
result:
ok answers are correct. (1 test case)
Test #52:
score: 15
Accepted
time: 0ms
memory: 4048kb
input:
1 500 469801418 543014146 88133056 907796982 371632401 651284421 215700096 770340130 43908894 949974227 228857314 763662824 96428585 878420222 358846586 659069102 342512323 678918835 418259745 622528727 409697819 630897028 419845825 616929433 422535725 601728016 343890155 676697170 459587703 5503620...
output:
412 142 1 148 211 246 406 200 350 322 161 109 416 104 245 15 306 239 407 115 40 22 214 497 310 492 66 178 348 299 250 131 114 150 260 388 53 486 270 90 221 195 57 370 201 253 449 165 152 420 203 375 35 177 288 13 481 324 313 367 72 12 439 428 162 337 10 231 218 113 404 132 181 123 491 403 11 308 17 ...
result:
ok answers are correct. (1 test case)
Test #53:
score: 15
Accepted
time: 0ms
memory: 3868kb
input:
10 50 207059937 753068238 180121652 843395001 89976589 910097214 454561729 475461835 30145643 958325187 468106776 475461835 216500729 732895985 186550878 842144439 216500729 730076513 201705854 784916523 101615777 887736079 146407771 854308076 352972448 569951085 146407771 854308076 186550878 843395...
output:
50 47 28 37 40 30 16 13 46 38 19 21 44 23 18 48 45 24 39 9 7 49 20 1 31 12 50 47 35 28 20 16 5 6 37 3 14 48 26 8 42 44 27 39 2 43 11 19 36 10 8 48 5 27 19 2 15 10 4 41 1 30 7 29 25 40 14 35 33 49 9 37 24 46 28 13 7 5 11 2 29 35 12 49 31 28 22 19 38 43 24 34 23 17 39 25 30 48 40 8 6 25 28 49 1 21...
result:
ok answers are correct. (10 test cases)
Test #54:
score: 15
Accepted
time: 0ms
memory: 4028kb
input:
10 50 96925135 119814173 496158611 512728287 175956964 182608264 651426656 775363792 800402590 803601033 277949571 285049833 459040129 519645784 584657755 622874674 48683750 255362883 835966114 846941081 9112059 997463383 328376408 939777438 273594271 983634047 570024836 938650380 648858690 89641384...
output:
1 37 21 23 3 32 38 43 9 44 6 50 33 41 36 2 16 7 25 31 30 12 34 35 46 24 42 15 25 46 49 19 50 13 7 30 48 16 1 21 40 33 34 2 44 38 32 39 47 27 48 20 30 10 26 28 42 35 2 27 14 6 36 50 12 34 24 23 9 13 18 16 22 11 32 34 13 48 28 42 19 49 3 20 25 10 21 41 44 11 2 50 17 40 30 31 22 7 16 29 29 13 49 23...
result:
ok answers are correct. (10 test cases)
Test #55:
score: 0
Time Limit Exceeded
input:
20 26 3 50 27 44 4 5 19 20 29 30 36 37 24 25 33 42 2 51 26 45 22 47 35 40 6 49 7 10 32 43 13 14 12 15 1 52 38 39 34 41 17 48 28 31 8 9 11 16 23 46 18 21 26 17 18 22 23 15 36 20 33 25 30 24 31 27 28 4 5 41 46 42 45 43 44 10 11 7 8 2 3 19 34 38 39 9 50 13 14 26 29 37 48 21 32 16 35 6 51 40 47 1 52 12 ...
output:
result:
Subtask #5:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
0%
Subtask #7:
score: 0
Skipped
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
0%
Subtask #8:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
0%