QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#833980#8907. Конференцияxlwang27 1ms4936kbC++143.3kb2024-12-27 09:31:542024-12-27 09:31:56

Judging History

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

  • [2024-12-27 09:31:56]
  • 评测
  • 测评结果:27
  • 用时:1ms
  • 内存:4936kb
  • [2024-12-27 09:31:54]
  • 提交

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,88,min(n,100)) 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: 4752kb

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

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

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:

675997198 677110562
169979836 171702782
274783103 276891956
153695701 153912073
930390886 930467950
908476501 909336129
917907156 921596638
979523599 981350417
336606611 337091150
129370496 130772798
770381189 770398840
436342577 436917499
607428860 608887704
2 3 4 5 6 7 8 9 11 18 21 23 28 29 30 31 ...

result:

wrong answer Integer parameter [name=/opt/uoj/judger/uoj_judger/work/3.ans_1] equals to 675997198, violates the range [1, 500] (test case 1)

Subtask #2:

score: 20
Accepted

Test #9:

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

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

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

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

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

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

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: 1ms
memory: 4936kb

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

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: 1ms
memory: 4864kb

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

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

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

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: 1ms
memory: 4852kb

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: 7
Accepted

Dependency #2:

100%
Accepted

Test #22:

score: 7
Accepted
time: 1ms
memory: 4816kb

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

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: 1ms
memory: 4788kb

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

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: 7
Accepted
time: 1ms
memory: 4888kb

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:

4 5 9 11 12 13 14 19 20 22 23 24 25 29 30 

result:

ok answers are correct. (1 test case)

Test #27:

score: 7
Accepted
time: 0ms
memory: 4784kb

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 11 12 13 14 15 18 19 21 22 23 24 26 29 30 

result:

ok answers are correct. (1 test case)

Test #28:

score: 7
Accepted
time: 0ms
memory: 4792kb

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:

11 12 14 15 16 18 20 21 23 24 25 27 28 29 30 

result:

ok answers are correct. (1 test case)

Test #29:

score: 7
Accepted
time: 1ms
memory: 4792kb

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:

7 8 9 12 13 16 17 18 20 22 23 24 26 28 29 

result:

ok answers are correct. (1 test case)

Test #30:

score: 7
Accepted
time: 1ms
memory: 4864kb

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:

1 2 3 9 12 13 14 16 17 18 24 26 27 28 

result:

ok answers are correct. (1 test case)

Test #31:

score: 7
Accepted
time: 0ms
memory: 4864kb

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:

3 5 8 10 13 15 17 20 21 23 24 26 28 29 30 

result:

ok answers are correct. (1 test case)

Test #32:

score: 7
Accepted
time: 1ms
memory: 4716kb

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:

3 5 6 8 9 11 13 15 16 22 24 26 27 29 30 

result:

ok answers are correct. (1 test case)

Test #33:

score: 7
Accepted
time: 1ms
memory: 4848kb

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:

1 2 4 5 6 8 12 13 15 19 20 22 23 25 29 

result:

ok answers are correct. (1 test case)

Test #34:

score: 7
Accepted
time: 1ms
memory: 4748kb

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:

5 6 7 11 12 13 14 15 18 19 22 24 26 27 29 

result:

ok answers are correct. (1 test case)

Test #35:

score: 7
Accepted
time: 1ms
memory: 4868kb

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:

1 3 4 7 8 10 11 12 15 17 18 19 23 24 27 

result:

ok answers are correct. (1 test case)

Test #36:

score: 7
Accepted
time: 1ms
memory: 4916kb

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:

1 2 3 8 12 15 16 19 21 22 23 25 26 28 30 

result:

ok answers are correct. (1 test case)

Test #37:

score: 7
Accepted
time: 1ms
memory: 4744kb

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:

6 8 9 10 11 13 16 17 18 19 22 23 24 25 28 

result:

ok answers are correct. (1 test case)

Test #38:

score: 7
Accepted
time: 1ms
memory: 4812kb

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 8 11 12 13 17 18 20 21 22 23 26 27 30 

result:

ok answers are correct. (1 test case)

Subtask #4:

score: 0
Wrong Answer

Test #39:

score: 15
Accepted
time: 0ms
memory: 4864kb

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

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:

150 163
119 120
13 36
148 165
179 180
29 32
104 107
60 81
7 8
75 78
122 123
178 191
142 169
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 150, 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:

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:

0%