結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-02-14 23:39:30 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 123 ms / 5,000 ms | 
| コード長 | 468 bytes | 
| コンパイル時間 | 1,787 ms | 
| コンパイル使用メモリ | 77,068 KB | 
| 実行使用メモリ | 46,752 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:09:07 | 
| 合計ジャッジ時間 | 4,953 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
import java.util.*;
class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int n = sc.nextInt();
		
		int[] ar = new int[10];
		for (int i=0; i<n; i++) {
			ar[sc.nextInt()-1]++; ar[sc.nextInt()-1]++; ar[sc.nextInt()-1]++;
		}
		
		
		int ans = 0;
		for (int i=0; i<10; i++) {
			ans += ar[i]/2;
			ar[i] %= 2;
		}
		
		int sum = 0;
		for (int i=0; i<10; i++) sum += ar[i];
		
		System.out.println(ans+sum/4);
		
	}
}
            
            
            
        