結果

問題 No.29 パワーアップ
コンテスト
ユーザー doyazaki012
提出日時 2015-05-01 18:03:16
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 502 bytes
コンパイル時間 2,009 ms
コンパイル使用メモリ 77,280 KB
実行使用メモリ 46,760 KB
最終ジャッジ日時 2025-10-24 20:52:53
合計ジャッジ時間 5,571 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Yuki29{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);

		int n = stdIn.nextInt();
		int[] count = new int[10];
		int box=0;
		int answer=0;


		for(int i=0;i<n*3;i++){
			int input = stdIn.nextInt();
			if(input==10) input =0;
			
			count[input] += 1;
			if(count[input]==2){
				count[input] -= 2;
				answer += 1;
			}

		}

		for(int  i=0;i<10;i++){
			box+=count[i];
		}

		answer += (int)(box/4);

		System.out.println(answer);
	}
}
0