-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathURI1171NumberFrequence.java
More file actions
36 lines (31 loc) · 951 Bytes
/
URI1171NumberFrequence.java
File metadata and controls
36 lines (31 loc) · 951 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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
/**
* See
* <a href="https://www.urionlinejudge.com.br/judge/en/problems/view/1171">Number
* Frequence</a>
*
* @author Brian Yeicol Restrepo Tangarife
*/
public class URI1171NumberFrequence {
static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
static PrintWriter out = new PrintWriter(System.out);
public static void main(String[] args) throws IOException {
int[] F = new int[2001];
int N = readInt();
while (N-- > 0) {
F[readInt()]++;
}
for (int i = 0; i < 2001; i++) {
if (F[i] > 0) {
out.println(i + " aparece " + F[i] + " vez(es)");
}
}
out.close();
}
private static int readInt() throws IOException {
return Integer.parseInt(in.readLine());
}
}