結果

問題 No.29 パワーアップ
ユーザー ogura(tes)ogura(tes)
提出日時 2014-11-25 18:15:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 569 bytes
コンパイル時間 3,336 ms
コンパイル使用メモリ 74,592 KB
実行使用メモリ 57,768 KB
最終ジャッジ日時 2023-08-30 23:01:04
合計ジャッジ時間 7,104 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,836 KB
testcase_01 AC 123 ms
55,708 KB
testcase_02 AC 124 ms
55,540 KB
testcase_03 AC 124 ms
56,212 KB
testcase_04 WA -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 120 ms
53,596 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 125 ms
56,040 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;


public class tast008 {
	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		// 整数の入力

		int N = sc.nextInt();
		int sum =0;
		int item[] = new int[10];
		Arrays.fill(item, 0);

		for(int i=0;i<N;i++){
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			item[a-1]++;
			item[b-1]++;
			item[c-1]++;
		}
		for(int i=0;i<N;i++){
			sum +=  (item[i])/2;
		} 

		sum += ((N*3)-(sum*2))/4;
		System.out.println(sum);
	}
}
0