-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP10989.java
More file actions
31 lines (26 loc) · 740 Bytes
/
P10989.java
File metadata and controls
31 lines (26 loc) · 740 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
package BOJ;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class P10989 {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[] arr = new int[10001];
int n = Integer.parseInt(br.readLine());
for(int i=0;i<n;i++){
int value = Integer.parseInt(br.readLine());
arr[value]++;
}
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
for(int i=1;i<10001;i++){
if(arr[i]>0){
for(int j=0;j<arr[i];j++){
bw.write(i+"\n");
}
}
}
bw.flush();
}
}