結果

問題 No.29 パワーアップ
ユーザー ogura(tes)
提出日時 2014-11-25 18:15:57
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 569 bytes
コンパイル時間 4,597 ms
コンパイル使用メモリ 85,036 KB
実行使用メモリ 56,564 KB
最終ジャッジ日時 2025-01-02 21:53:55
合計ジャッジ時間 6,991 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 3 RE * 13
権限があれば一括ダウンロードができます

ソースコード

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