We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b00127b commit 9c773d6Copy full SHA for 9c773d6
1 file changed
260401/중복되지 않는 정수 중 최대/max-of-unique-number.java
@@ -0,0 +1,27 @@
1
+import java.io.*;
2
+import java.util.*;
3
+
4
+public class Main {
5
+ public static void main(String[] args) throws Exception {
6
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
7
8
+ int N = Integer.parseInt(br.readLine());
9
10
+ StringTokenizer st = new StringTokenizer(br.readLine());
11
12
+ int[] arr = new int[1001];
13
14
+ while(st.hasMoreTokens()){
15
+ int value = Integer.parseInt(st.nextToken());
16
+ arr[value]++;
17
+ }
18
19
+ int max = -1;
20
+ for(int i=1; i<=1000; i++){
21
+ if(arr[i]==1 && max < arr[i]){
22
+ max = i;
23
24
25
+ System.out.println(max);
26
27
+}
0 commit comments