結果

問題 No.29 パワーアップ
コンテスト
ユーザー ogura(tes)
提出日時 2014-11-25 18:19:09
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 65 ms / 5,000 ms
+ 250µs
コード長 570 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,104 ms
コンパイル使用メモリ 84,152 KB
実行使用メモリ 43,516 KB
最終ジャッジ日時 2026-07-15 21:24:17
合計ジャッジ時間 4,771 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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