QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#770938#7953. Product DeliveryvwxyzTL 136ms20100kbPython3256b2024-11-22 03:43:302024-11-22 03:43:30

Judging History

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

  • [2024-11-22 03:43:30]
  • 评测
  • 测评结果:TL
  • 用时:136ms
  • 内存:20100kb
  • [2024-11-22 03:43:30]
  • 提交

answer

N=int(input())
L,R=[],[]
for i in range(N):
    l,r=map(int,input().split())
    L.append(l)
    R.append(r)
ans=0
cur=-1
for l,r in zip(L[::-1],R[::-1]):
    if l<=cur:
        cur=min(cur,r)
    else:
        ans+=1
        cur=r
print(ans)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 8ms
memory: 10708kb

input:

4
13 15
5 8
6 14
3 7

output:

2

result:

ok single line: '2'

Test #2:

score: 0
Accepted
time: 9ms
memory: 10584kb

input:

5
1 2
2 3
33 44
4 5
6 7

output:

2

result:

ok single line: '2'

Test #3:

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

input:

5
10 20
3 6
13 30
7 8
11 13

output:

3

result:

ok single line: '3'

Test #4:

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

input:

10000
9915 10554
10838 11379
11776 12657
12806 12963
13167 13833
14451 15021
14759 16130
16101 16780
16879 17295
17659 18207
18136 18705
19184 20065
20015 20660
20265 21316
21804 22253
21954 23283
22862 24108
24131 24588
24337 25510
25451 26586
26724 27483
27211 28088
28107 29022
28947 29794
29924 3...

output:

10

result:

ok single line: '10'

Test #5:

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

input:

10000
9573 10124
10578 10742
11109 12182
12532 12917
13140 13884
13751 15238
15247 15518
15807 16483
16933 17964
17583 18882
18320 19167
19744 20237
20776 21056
21337 22594
22321 23558
22856 24308
23626 24973
25395 26206
26037 26618
27290 27450
28214 28696
28639 29369
29607 30493
30814 31602
31189 3...

output:

100

result:

ok single line: '100'

Test #6:

score: 0
Accepted
time: 21ms
memory: 11564kb

input:

10000
6362 6874
6728 7647
8211 8515
8557 9634
9900 10372
10833 11620
11204 12102
12622 12716
13454 14355
13765 14489
14990 15900
15388 16690
16354 17076
17380 18620
18109 19444
18877 19868
20405 20721
21379 22033
22029 22344
23013 23743
23187 24862
24286 25690
25269 26077
26321 26718
26661 27965
280...

output:

20

result:

ok single line: '20'

Test #7:

score: 0
Accepted
time: 19ms
memory: 11652kb

input:

10000
6461 7187
7338 7755
7430 8215
8052 8487
8654 9043
9362 9471
9616 10117
10413 10780
10773 10969
10937 11441
11746 11951
12359 12732
12517 13215
13196 13613
13534 14010
14127 14666
14734 15379
15318 15698
16033 16511
16239 16736
16731 17560
17470 17811
17924 18184
18345 19052
18707 19460
19141 2...

output:

50

result:

ok single line: '50'

Test #8:

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

input:

10000
224 1039
1343 2072
1815 2710
3197 3438
3957 4264
4984 5577
5791 6395
5941 6960
7255 7423
7736 8789
1540 1915
2172 3061
3442 3716
3863 5157
5040 5601
6233 6930
7083 7596
7965 8517
8490 9929
10041 11059
11079 11775
11615 12746
12853 13201
13064 14417
14290 15551
15191 16677
16668 17793
17425 178...

output:

500

result:

ok single line: '500'

Test #9:

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

input:

10000
6256380 6256816
6255649 6256246
6255120 6255151
6254471 6254803
6253878 6254143
6253183 6253293
6252650 6253019
6251906 6251975
6251307 6251517
6250657 6250816
6250073 6250188
6249440 6249973
6248909 6249272
6248530 6248556
6248045 6248069
6246975 6247247
6246437 6246768
6245895 6245953
624504...

output:

10000

result:

ok single line: '10000'

Test #10:

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

input:

10000
9446 9501
9529 9656
10226 10250
11148 11183
11438 11508
12155 12173
12661 13149
13312 13355
13912 14147
14693 14696
15195 15203
15914 16353
16785 16902
17436 17550
17730 18199
18627 18773
19067 19208
19775 19854
20176 20236
21226 21327
21392 21500
22129 22527
22872 22997
23673 23750
24096 2438...

output:

1

result:

ok single line: '1'

Test #11:

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

input:

10000
405 10831
1214 7121
495 2805
1476 5976
845 6238
3871 5850
1056 6749
2076 9606
1867 10561
302 10055
7141 9115
916 3134
2164 3511
922 6470
5308 11064
6298 10388
6847 8032
6486 9046
6582 7476
5650 10921
847 1442
3676 6282
1162 8017
3836 6361
4746 7522
2626 8797
8076 11095
9313 10069
1782 9286
115...

output:

2272

result:

ok single line: '2272'

Test #12:

score: 0
Accepted
time: 121ms
memory: 20024kb

input:

100000
9915 10554
10838 11379
11776 12657
12806 12963
13167 13833
14451 15021
14759 16130
16101 16780
16879 17295
17659 18207
18136 18705
19184 20065
20015 20660
20265 21316
21804 22253
21954 23283
22862 24108
24131 24588
24337 25510
25451 26586
26724 27483
27211 28088
28107 29022
28947 29794
29924 ...

output:

10

result:

ok single line: '10'

Test #13:

score: 0
Accepted
time: 136ms
memory: 20016kb

input:

100000
9573 10124
10578 10742
11109 12182
12532 12917
13140 13884
13751 15238
15247 15518
15807 16483
16933 17964
17583 18882
18320 19167
19744 20237
20776 21056
21337 22594
22321 23558
22856 24308
23626 24973
25395 26206
26037 26618
27290 27450
28214 28696
28639 29369
29607 30493
30814 31602
31189 ...

output:

100

result:

ok single line: '100'

Test #14:

score: 0
Accepted
time: 133ms
memory: 20000kb

input:

100000
6362 6874
6728 7647
8211 8515
8557 9634
9900 10372
10833 11620
11204 12102
12622 12716
13454 14355
13765 14489
14990 15900
15388 16690
16354 17076
17380 18620
18109 19444
18877 19868
20405 20721
21379 22033
22029 22344
23013 23743
23187 24862
24286 25690
25269 26077
26321 26718
26661 27965
28...

output:

20

result:

ok single line: '20'

Test #15:

score: 0
Accepted
time: 136ms
memory: 19992kb

input:

100000
6461 7187
7338 7755
7430 8215
8052 8487
8654 9043
9362 9471
9616 10117
10413 10780
10773 10969
10937 11441
11746 11951
12359 12732
12517 13215
13196 13613
13534 14010
14127 14666
14734 15379
15318 15698
16033 16511
16239 16736
16731 17560
17470 17811
17924 18184
18345 19052
18707 19460
19141 ...

output:

50

result:

ok single line: '50'

Test #16:

score: 0
Accepted
time: 132ms
memory: 20016kb

input:

100000
10067 10708
10513 11993
11402 12460
12095 13159
13564 14198
14356 14623
14865 15870
15806 16671
16422 16913
16972 17965
18420 19064
18958 19551
19929 20150
20551 21383
20992 22103
21886 23275
23039 23614
23487 24553
24545 25511
25219 26099
26087 26839
26920 27524
27517 28795
28823 29038
29428...

output:

500

result:

ok single line: '500'

Test #17:

score: 0
Accepted
time: 102ms
memory: 20100kb

input:

100000
62506380 62506816
62505649 62506246
62505120 62505151
62504471 62504803
62503878 62504143
62503183 62503293
62502650 62503019
62501906 62501975
62501307 62501517
62500657 62500816
62500073 62500188
62499440 62499973
62498909 62499272
62498530 62498556
62498045 62498069
62496975 62497247
62496...

output:

100000

result:

ok single line: '100000'

Test #18:

score: 0
Accepted
time: 129ms
memory: 20040kb

input:

100000
9446 9501
9529 9656
10226 10250
11148 11183
11438 11508
12155 12173
12661 13149
13312 13355
13912 14147
14693 14696
15195 15203
15914 16353
16785 16902
17436 17550
17730 18199
18627 18773
19067 19208
19775 19854
20176 20236
21226 21327
21392 21500
22129 22527
22872 22997
23673 23750
24096 243...

output:

1

result:

ok single line: '1'

Test #19:

score: 0
Accepted
time: 131ms
memory: 19708kb

input:

100000
405 10831
1214 7121
495 2805
1476 5976
845 6238
3871 5850
1056 6749
2076 9606
1867 10561
302 10055
7141 9115
916 3134
2164 3511
922 6470
5308 11064
6298 10388
6847 8032
6486 9046
6582 7476
5650 10921
847 1442
3676 6282
1162 8017
3836 6361
4746 7522
2626 8797
8076 11095
9313 10069
1782 9286
11...

output:

22758

result:

ok single line: '22758'

Test #20:

score: -100
Time Limit Exceeded

input:

1000000
1869 2662
2491 3484
2917 3933
3787 4650
4311 5392
5190 6184
6296 6743
6465 7804
7678 8554
8459 9244
9075 9795
9731 10350
10337 11257
11333 11660
11974 12656
12284 13324
13433 13862
13968 15015
14386 15745
15548 16338
16025 16782
17069 17872
17725 18225
18431 18992
19096 19905
19934 20619
200...

output:


result: