結果

問題 No.29 パワーアップ
ユーザー Mcpu3Mcpu3
提出日時 2018-07-05 18:47:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 5,000 ms
コード長 429 bytes
コンパイル時間 4,192 ms
コンパイル使用メモリ 71,932 KB
実行使用メモリ 56,336 KB
最終ジャッジ日時 2023-09-13 18:00:52
合計ジャッジ時間 6,990 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,764 KB
testcase_01 AC 123 ms
55,816 KB
testcase_02 AC 123 ms
56,032 KB
testcase_03 AC 126 ms
55,820 KB
testcase_04 AC 125 ms
55,996 KB
testcase_05 AC 142 ms
55,960 KB
testcase_06 AC 142 ms
56,156 KB
testcase_07 AC 131 ms
55,776 KB
testcase_08 AC 129 ms
56,120 KB
testcase_09 AC 124 ms
55,748 KB
testcase_10 AC 143 ms
56,104 KB
testcase_11 AC 142 ms
56,128 KB
testcase_12 AC 125 ms
56,232 KB
testcase_13 AC 137 ms
55,776 KB
testcase_14 AC 140 ms
55,744 KB
testcase_15 AC 138 ms
55,788 KB
testcase_16 AC 137 ms
56,336 KB
testcase_17 AC 130 ms
56,112 KB
testcase_18 AC 137 ms
55,716 KB
testcase_19 AC 135 ms
56,088 KB
testcase_20 AC 126 ms
56,020 KB
testcase_21 AC 125 ms
55,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no29{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int n=stdIn.nextInt(),i,j,t,a[]=new int[10],s=0;
		for(i=0;i<n;i++) {
			for(j=0;j<3;j++) {
				t=stdIn.nextInt();
				a[t-1]++;
			}
		}
		for(i=0;i<10;i++) {
			while(a[i]>1) {
				a[i]-=2;
				s++;
			}
		}
		t=0;
		for(i=0;i<10;i++) t+=a[i];
		s+=t/4;
		System.out.print(s);
	}
}
0