結果

問題 No.29 パワーアップ
ユーザー papipen
提出日時 2017-04-06 19:59:15
言語 Java
(openjdk 23)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 411 bytes
コンパイル時間 1,786 ms
コンパイル使用メモリ 74,660 KB
実行使用メモリ 54,292 KB
最終ジャッジ日時 2024-07-17 21:31:12
合計ジャッジ時間 5,662 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class N029{
	public static void main(String args[]){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int a[] = new int[10];
		for(int i = 0; i < n * 3; i++){
			int b = s.nextInt();
			a[b - 1]++;
		}
		
		int count = 0 , sum = 0;
		for(int i = 0; i < 10; i++){
			sum += a[i] / 2;
			if(a[i] % 2 == 1){
				count++;
			}
		}
		System.out.println(sum + count / 4);
	}
}
0