結果

問題 No.29 パワーアップ
ユーザー shinwisteriashinwisteria
提出日時 2018-03-04 16:41:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 157 ms / 5,000 ms
コード長 458 bytes
コンパイル時間 4,114 ms
コンパイル使用メモリ 71,620 KB
実行使用メモリ 55,792 KB
最終ジャッジ日時 2023-09-22 09:23:54
合計ジャッジ時間 8,453 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 141 ms
55,652 KB
testcase_01 AC 141 ms
55,576 KB
testcase_02 AC 141 ms
55,644 KB
testcase_03 AC 140 ms
55,488 KB
testcase_04 AC 139 ms
55,708 KB
testcase_05 AC 156 ms
55,636 KB
testcase_06 AC 156 ms
51,424 KB
testcase_07 AC 146 ms
55,564 KB
testcase_08 AC 145 ms
55,676 KB
testcase_09 AC 138 ms
55,792 KB
testcase_10 AC 156 ms
55,492 KB
testcase_11 AC 157 ms
55,488 KB
testcase_12 AC 138 ms
55,584 KB
testcase_13 AC 156 ms
55,708 KB
testcase_14 AC 155 ms
55,700 KB
testcase_15 AC 153 ms
55,612 KB
testcase_16 AC 153 ms
55,608 KB
testcase_17 AC 141 ms
55,396 KB
testcase_18 AC 146 ms
55,648 KB
testcase_19 AC 149 ms
55,308 KB
testcase_20 AC 136 ms
55,512 KB
testcase_21 AC 135 ms
55,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Scanner;
public class Con29 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int N = s.nextInt() , count = 0;
		int[] item = new int[10];
		for(int i = 0;i < 3*N;i++){
			int k = s.nextInt();
			item[k-1]++;
			if(item[k-1] == 2){
				count++;
				item[k-1] = 0;
			}
		}
		s.close();

		N = 0;
		for(int i = 0;i < 10;i++){
			N += item[i];
		}
		System.out.println(count + N / 4);

	}

}
0