用户输出
2
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#80782 | #1110. JM的算命之术 | Accepted | 100 | 555 ms | 1792 K | C++ 17 / 513 B | 规培005 贺晓珉 | 2022-08-02 14:41:56 |
#include <bits/stdc++.h>
using namespace std;
typedef struct {
int a;
int b;
} tim;
tim arr[1000010];
int cnt = 1;
int n;
bool cmp(tim x, tim y) { return x.b < y.b; }
int main() {
cin >> n;
for (int i = 0; i < n; i++) cin >> arr[i].a >> arr[i].b;
sort(arr, arr + n, cmp);
int max_time = arr[0].b;
for (int i = 1; i < n; i++) {
if (arr[i].a > max_time) {
cnt++;
max_time = arr[i].b;
}
}
cout << cnt;
return 0;
}
35
66 80
32 38
34 35
67 68
53 94
22 74
4 51
49 73
48 91
32 65
7 98
34 44
17 84
59 97
<146 bytes omitted>
用户输出
6
系统信息
Exited with return code 0
78
24 68
23 82
79 100
49 95
55 84
17 21
2 63
23 68
6 42
57 63
18 53
9 58
65 93
70 100
<450 bytes omitted>
用户输出
10
系统信息
Exited with return code 0
854
5467 8458
7427 9416
1559 9082
3181 3196
5447 6826
1999 2772
2244 3428
4117 7212
3813 64
<9182 bytes omitted>
用户输出
49
系统信息
Exited with return code 0
240
1953 7979
5806 6542
7242 9133
8990 9000
4834 5545
8182 9685
5894 9586
3365 8189
5 6
11
<2511 bytes omitted>
用户输出
25
系统信息
Exited with return code 0
30032
218959965 690036290
166253959 736069436
361427788 677032424
118917380 279117898
623364376
<627172 bytes omitted>
用户输出
264
系统信息
Exited with return code 0
45898
765768824 839988892
891645120 934820639
897049089 915703888
819012894 912957740
30009705
<958340 bytes omitted>
用户输出
351
系统信息
Exited with return code 0
25774
6004221 6004422
2395416 2395775
222086 222631
6374948 6375202
1191857 1192036
6457035 64
<432371 bytes omitted>
用户输出
12396
系统信息
Exited with return code 0
50591
8627751 8628150
6758169 6758440
1079056 1079416
4278009 4278052
1047972 1047975
66222 66
<848740 bytes omitted>
用户输出
17853
系统信息
Exited with return code 0
100000
400381387 805067386
967986006 976613391
358312144 799345458
407097998 966818388
72874808
<2088199 bytes omitted>
用户输出
511
系统信息
Exited with return code 0
200000
81284010 81284629
9776763 9777717
63372394 63372950
66341771 66341828
61340861 61341254
<3755341 bytes omitted>
用户输出
107784
系统信息
Exited with return code 0