#13990: AC_HAHA


terry90209@gmail.com (Mini)

學校 : 不指定學校
編號 : 78019
來源 : [219.71.215.231]
最後登入時間 :
2018-04-03 22:44:44
d244. 一堆石頭 | From: [219.71.215.231] | 發表日期 : 2018-05-26 09:16

import java.util.Arrays;
public class D244{
public static void main(String[] args){
java.util.Scanner sc = new java.util.Scanner(System.in);
System.out.println(new Stone(sc.nextLine()).check());
}
}

class Stone{
private int[] a;

public Stone(String s){
String[] str = s.split(" ");
a = new int[str.length];
for(int i = 0 ; i < str.length; i++)
a[i] = Integer.parseInt(str[i]);
Arrays.sort(a);
}

public int check(){
int num = 0;
for(int i = 0,j = 1, k = 2;i < a.length; i += 3, j += 3, k += 3){
if(a[i] != a[j] || a[i] != a[k]){
num = a[i];
break;
}
}
return num;
}
}

 
ZeroJudge Forum