-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path237A.java
More file actions
43 lines (33 loc) · 891 Bytes
/
Copy path237A.java
File metadata and controls
43 lines (33 loc) · 891 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
36
37
38
39
40
41
42
43
import java.util.*;
public class FreeCash {
static boolean areEqual (int[] x, int[] y) {
if (x[0]==y[0] && x[1]==y[1]) {
return true;
} else {
return false;
}
}
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[][] times = new int [n][2];
for (int i = 0; i < n; i++) {
for (int j = 0; j < 2; j++) {
times[i][j] = sc.nextInt();
}
}
int ans = 1, curr;
for (int i = 0; i < n-1; i++) {
curr = 1;
while (i+1 < n && areEqual(times[i], times[i+1])) {
curr++;
i++;
}
if (curr > ans) {
ans = curr;
}
}
System.out.println(ans);
sc.close();
}
}