結果

問題 No.29 パワーアップ
ユーザー ogura(tes)
提出日時 2014-11-25 18:19:09
言語 Java
(openjdk 23)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 570 bytes
コンパイル時間 4,619 ms
コンパイル使用メモリ 80,556 KB
実行使用メモリ 54,568 KB
最終ジャッジ日時 2025-01-02 21:54:20
合計ジャッジ時間 8,238 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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<10;i++){
			sum +=  (item[i])/2;
		} 

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