QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#833992 | #8907. Конференция | xlwang | 20 | 1ms | 4972kb | C++14 | 3.3kb | 2024-12-27 09:39:33 | 2024-12-27 09:39:36 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define fr(i,j,k) for(register int i=j;i<=k;++i)
#define rf(i,j,k) for(register int i=j;i>=k;--i)
#define foredge(i,j) for(register int i=head[j];i;i=e[i].nxt)
#define pb push_back
#define Times printf("Time:%.3lf\n",clock()/CLOCKS_PER_SEC)
#define pii pair<int,int>
#define mk make_pair
using namespace std;
inline int read(){
int x=0;
bool f=0;
char c=getchar();
while(!isdigit(c)) f|=(c=='-'),c=getchar();
while(isdigit(c)) x=(x<<3)+(x<<1)+(c^48),c=getchar();
return f?-x:x;
}
inline void write(int x){
if(x<0){putchar('-');x=-x;}
if(x>9)write(x/10);
putchar(x%10+'0');
}
inline void writeln(int x){write(x); puts("");}
inline void writepl(int x){write(x); putchar(' ');}
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline int randfind(int l,int r){return rnd()%(r-l+1)+l;}
const int Maxn=1e5+10;
struct node{
pii l;
int id;
}e[Maxn];
int n;
inline bool cmp1(node A,node B){return A.l.second<B.l.second;}
inline bool cmp2(node A,node B){return A.l.first>B.l.first;}
int chs[Maxn],vis[Maxn];
inline void clear(){fr(i,1,n) vis[i]=chs[i]=0;}
inline void work(){
n=read();
fr(i,1,n) e[i].l.first=read(),e[i].l.second=read(),e[i].id=i;
fr(i,30,min(n,49)) cout<<e[i].l.first<<' '<<e[i].l.second<<endl;
int m=0;sort(e+1,e+n+1,cmp1);
int lst=0;
fr(i,1,n){
if(lst<e[i].l.first) ++m,lst=e[i].l.second;
}
// cout<<m<<endl;
int now=0;lst=0;
int _n=0;
fr(i,1,n){
if(lst<e[i].l.first){
++now;
chs[e[i].id]=vis[e[i].id]=1;
++_n;
lst=e[i].l.second;
if(now==(m/2)){
fr(j,i+1,n) if(e[j].l.first<=lst) ++_n,chs[e[j].id]=1;
break;
}
}
else {
chs[e[i].id]=1;
++_n;
}
}
// cout<<m<<endl;
// cout<<_n<<endl;
if(now==m/2 && _n>=n/2){
fr(i,1,n){
if(_n==(n/2)) break;
if(!chs[i]) continue;
if(vis[i]) continue;
chs[i]=0;--_n;
}
fr(i,1,n) if(chs[i]) writepl(i);puts("");
clear();
return;
}
now=lst=_n=0;
sort(e+1,e+n+1,cmp2);
// fr(i,1,n) cout<<e[i].l.first<<' '<<e[i].l.second<<endl;
lst=2e9;clear();
fr(i,1,n){
if(e[i].l.second<lst){
++now;
chs[e[i].id]=vis[e[i].id]=1;
++_n;
lst=e[i].l.first;
if(now==m/2){
fr(j,i+1,n) if(e[i].l.second>=lst) ++_n,chs[e[j].id]=1;
break;
}
}
else {
chs[e[i].id]=1;
++_n;
}
}
// cout<<_n<<endl;
if(now==m/2 && _n>=n/2){
fr(i,1,n){
if(_n==(n/2)) break;
if(!chs[i]) continue;
if(vis[i]) continue;
chs[i]=0;--_n;
}
fr(i,1,n) if(chs[i]) writepl(i);puts("");
clear();
return;
}
}
inline void init(){
int t=read();
while(t--) work();
}
signed main(){
// freopen("input.in","r",stdin);
// freopen("output.out","w",stdout);
init();
// printf("\nTIME:%.3lf",(double)clock()/CLOCKS_PER_SEC);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 5
Accepted
time: 1ms
memory: 4884kb
input:
1 4 823983109 859315505 510901709 589624124 351308325 413158126 29447781 138101981
output:
3 4
result:
ok answers are correct. (1 test case)
Test #2:
score: 5
Accepted
time: 1ms
memory: 4760kb
input:
1 10 344190293 385750493 951894838 978895800 82358344 338131819 540516504 607653166 820688970 951835774 395392706 419489159 623802732 644208366 798160348 818154082 680378878 682083538 467019518 519267671
output:
1 3 4 6 10
result:
ok answers are correct. (1 test case)
Test #3:
score: 0
Wrong Answer
time: 1ms
memory: 4888kb
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:
22222089 23966951 347918490 348414901 930235788 930339713 199549368 202741328 976452500 977602018 728795036 732111564 947302812 947985900 84803300 85174128 171889791 173867877 713292858 714248923 320758652 321446771 344176515 344256823 90153823 90251685 290028729 290744733 421395332 421404781 376471...
result:
wrong answer Integer parameter [name=/opt/uoj/judger/uoj_judger/work/3.ans_1] equals to 22222089, violates the range [1, 500] (test case 1)
Subtask #2:
score: 20
Accepted
Test #9:
score: 20
Accepted
time: 1ms
memory: 4756kb
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 5 7 8 9
result:
ok answers are correct. (1 test case)
Test #10:
score: 20
Accepted
time: 1ms
memory: 4820kb
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 6 7 8 9
result:
ok answers are correct. (1 test case)
Test #11:
score: 20
Accepted
time: 1ms
memory: 4948kb
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:
8 9 10 11 12 13 14
result:
ok answers are correct. (1 test case)
Test #12:
score: 20
Accepted
time: 1ms
memory: 4880kb
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:
4 5 7 10 11 12 15 16
result:
ok answers are correct. (1 test case)
Test #13:
score: 20
Accepted
time: 1ms
memory: 4768kb
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:
3 7 9 10 11 13 14 16 18 19
result:
ok answers are correct. (1 test case)
Test #14:
score: 20
Accepted
time: 1ms
memory: 4812kb
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:
3 9 11 12 14 15 16 17 19 20
result:
ok answers are correct. (1 test case)
Test #15:
score: 20
Accepted
time: 0ms
memory: 4896kb
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:
6 7 8 10 11 13 15 17 18 20
result:
ok answers are correct. (1 test case)
Test #16:
score: 20
Accepted
time: 0ms
memory: 4964kb
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:
1 2 8 13 14 15 16 17 19 20
result:
ok answers are correct. (1 test case)
Test #17:
score: 20
Accepted
time: 0ms
memory: 4888kb
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:
1 2 3 4 5 10 13 16 17
result:
ok answers are correct. (1 test case)
Test #18:
score: 20
Accepted
time: 0ms
memory: 4824kb
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:
1 2 6 10 11 12 13 15 19 20
result:
ok answers are correct. (1 test case)
Test #19:
score: 20
Accepted
time: 1ms
memory: 4824kb
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 3 4 5 8 10 14 15 16 20
result:
ok answers are correct. (1 test case)
Test #20:
score: 20
Accepted
time: 1ms
memory: 4884kb
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:
1 2 4 5 10 11 14 15 16 17
result:
ok answers are correct. (1 test case)
Test #21:
score: 20
Accepted
time: 0ms
memory: 4760kb
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:
2 3 4 5 10 11 16 18 19 20
result:
ok answers are correct. (1 test case)
Subtask #3:
score: 0
Wrong Answer
Dependency #2:
100%
Accepted
Test #22:
score: 7
Accepted
time: 1ms
memory: 4888kb
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:
5 6 7 8 12 14 16 18 19 20
result:
ok answers are correct. (1 test case)
Test #23:
score: 7
Accepted
time: 1ms
memory: 4756kb
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:
10 11 12 13 14 15 16 17 18 19 21
result:
ok answers are correct. (1 test case)
Test #24:
score: 7
Accepted
time: 0ms
memory: 4824kb
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 5 9 11 12 13 14 16 17 18 19 24
result:
ok answers are correct. (1 test case)
Test #25:
score: 7
Accepted
time: 1ms
memory: 4896kb
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 13 14 15 17 18 19 20 21 22 23 24 26
result:
ok answers are correct. (1 test case)
Test #26:
score: 0
Wrong Answer
time: 1ms
memory: 4972kb
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:
19 21 4 5 9 11 12 13 14 19 20 22 23 24 25 29 30
result:
wrong answer Index 19 encountered twice (test case 1)
Subtask #4:
score: 0
Wrong Answer
Test #39:
score: 15
Accepted
time: 1ms
memory: 4896kb
input:
1 10 8 9 15 18 12 13 5 14 7 10 1 20 2 19 6 11 3 4 16 17
output:
1 6 7 8 9
result:
ok answers are correct. (1 test case)
Test #40:
score: 0
Wrong Answer
time: 1ms
memory: 4796kb
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:
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 93 96 153 158 145 168 160 161 146 167 65 80 3 4 10 13 16 31 34 47 55 56 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
result:
wrong answer Integer parameter [name=/opt/uoj/judger/uoj_judger/work/40.ans_1] equals to 124, violates the range [1, 100] (test case 1)
Subtask #5:
score: 0
Skipped
Dependency #1:
0%
Subtask #6:
score: 0
Skipped
Dependency #2:
100%
Accepted
Dependency #3:
0%
Subtask #7:
score: 0
Skipped
Dependency #2:
100%
Accepted
Dependency #3:
0%
Subtask #8:
score: 0
Skipped
Dependency #1:
0%