結果

問題 No.29 パワーアップ
ユーザー doyazaki012doyazaki012
提出日時 2015-05-01 18:03:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 190 ms / 5,000 ms
コード長 502 bytes
コンパイル時間 3,170 ms
コンパイル使用メモリ 71,760 KB
実行使用メモリ 55,984 KB
最終ジャッジ日時 2023-09-19 04:53:43
合計ジャッジ時間 6,866 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
55,876 KB
testcase_01 AC 134 ms
55,456 KB
testcase_02 AC 134 ms
55,860 KB
testcase_03 AC 137 ms
55,676 KB
testcase_04 AC 134 ms
55,724 KB
testcase_05 AC 190 ms
55,696 KB
testcase_06 AC 150 ms
55,672 KB
testcase_07 AC 141 ms
55,520 KB
testcase_08 AC 133 ms
55,704 KB
testcase_09 AC 129 ms
55,724 KB
testcase_10 AC 149 ms
55,732 KB
testcase_11 AC 154 ms
55,728 KB
testcase_12 AC 141 ms
55,568 KB
testcase_13 AC 143 ms
55,984 KB
testcase_14 AC 146 ms
55,676 KB
testcase_15 AC 150 ms
55,452 KB
testcase_16 AC 150 ms
55,508 KB
testcase_17 AC 134 ms
55,840 KB
testcase_18 AC 138 ms
55,916 KB
testcase_19 AC 140 ms
55,936 KB
testcase_20 AC 132 ms
55,872 KB
testcase_21 AC 132 ms
55,728 KB
権限があれば一括ダウンロードができます

ソースコード

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