-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
27 lines (23 loc) · 796 Bytes
/
Main.java
File metadata and controls
27 lines (23 loc) · 796 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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
for(int i=0; i<10; i++){
st = new StringTokenizer(br.readLine());
int num = Integer.parseInt(st.nextToken())%42;
if(map.containsKey(num)){
map.put(num, map.get(num)+1);
} else {
map.put(num, 1);
}
}
System.out.println(map.size());
}
}