用户输出
2
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#19413 | #1110. JM的算命之术 | Accepted | 100 | 223 ms | 1904 K | C++ / 531 B | zz_ylolita | 2019-07-19 12:18:15 |
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
int n;
struct node {
int l, r;
} a[200010];
int ans, last;
int cmp(node a, node b) { return a.l > b.l || a.l == b.l && a.r < b.r; }
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) scanf("%d%d", &a[i].l, &a[i].r);
sort(a + 1, a + n + 1, cmp);
ans = 1;
last = a[1].l;
for (int i = 2; i <= n; i++) {
if (a[i].r >= last)
continue;
ans++;
last = a[i].l;
}
printf("%d\n", ans);
}
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