結果

問題 No.29 パワーアップ
ユーザー papipenpapipen
提出日時 2017-04-06 19:59:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 151 ms / 5,000 ms
コード長 411 bytes
コンパイル時間 2,183 ms
コンパイル使用メモリ 71,932 KB
実行使用メモリ 56,132 KB
最終ジャッジ日時 2023-09-24 21:04:03
合計ジャッジ時間 6,769 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
56,028 KB
testcase_01 AC 125 ms
55,732 KB
testcase_02 AC 123 ms
55,824 KB
testcase_03 AC 129 ms
55,704 KB
testcase_04 AC 127 ms
55,756 KB
testcase_05 AC 145 ms
55,412 KB
testcase_06 AC 143 ms
56,116 KB
testcase_07 AC 133 ms
55,924 KB
testcase_08 AC 131 ms
55,720 KB
testcase_09 AC 130 ms
55,708 KB
testcase_10 AC 142 ms
55,812 KB
testcase_11 AC 151 ms
56,132 KB
testcase_12 AC 129 ms
55,552 KB
testcase_13 AC 141 ms
55,672 KB
testcase_14 AC 143 ms
56,108 KB
testcase_15 AC 145 ms
55,660 KB
testcase_16 AC 142 ms
55,784 KB
testcase_17 AC 135 ms
55,772 KB
testcase_18 AC 135 ms
55,744 KB
testcase_19 AC 135 ms
55,756 KB
testcase_20 AC 122 ms
55,820 KB
testcase_21 AC 125 ms
56,016 KB
権限があれば一括ダウンロードができます

ソースコード

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