QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#302358#7953. Product DeliveryPetroTarnavskyi#WA 2ms3620kbC++20684b2024-01-10 19:48:502024-01-10 19:48:50

Judging History

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

  • [2024-01-10 19:48:50]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3620kb
  • [2024-01-10 19:48:50]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); i--)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;

int main()
{
	ios::sync_with_stdio(0); 
	cin.tie(0);
	cout << fixed << setprecision(15);
	
	int n;
	cin >> n;
	int L = 0;
	int ans = 1;
	FOR(i, 0, n)
	{
		int l, r;
		cin >> l >> r;
		if(r < L)
			ans++;
		L = l;
	}
	cout << ans << "\n";
	
	
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3568kb

input:

4
13 15
5 8
6 14
3 7

output:

2

result:

ok single line: '2'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3384kb

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

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

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

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: 2ms
memory: 3580kb

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

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

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: 2ms
memory: 3500kb

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: 2ms
memory: 3620kb

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: -100
Wrong Answer
time: 2ms
memory: 3396kb

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:

1634

result:

wrong answer 1st lines differ - expected: '2272', found: '1634'