結果

問題 No.29 パワーアップ
コンテスト
ユーザー doyazaki012
提出日時 2015-05-01 18:03:16
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 65 ms / 5,000 ms
+ 493µs
コード長 502 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,370 ms
コンパイル使用メモリ 84,056 KB
実行使用メモリ 43,312 KB
最終ジャッジ日時 2026-07-15 21:28:33
合計ジャッジ時間 3,953 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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