forked from DreamCats/java-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
35 lines (28 loc) · 718 Bytes
/
Test.java
File metadata and controls
35 lines (28 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* @program JavaBooks
* @description: 测试
* @author: mf
* @create: 2020/05/24 00:04
*/
package Test;
import java.util.Scanner;
public class Test {
public static void main(String[] args) throws InterruptedException {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] nums = new int[100001];
for (int i = 0; i < n; i++){
int x = sc.nextInt();
int y = sc.nextInt();
nums[x]++;
nums[y]--;
}
int cnt = 0;
int res = 0;
for (int i = 1; i < nums.length; i++){
cnt += nums[i];
res = Math.max(res, cnt);
}
System.out.println(res);
}
}