結果
| 問題 | 
                            No.29 パワーアップ
                             | 
                    
| コンテスト | |
| ユーザー | 
                             abc
                         | 
                    
| 提出日時 | 2016-10-21 11:36:24 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 841 bytes | 
| コンパイル時間 | 2,131 ms | 
| コンパイル使用メモリ | 80,384 KB | 
| 実行使用メモリ | 46,880 KB | 
| 最終ジャッジ日時 | 2025-10-24 20:59:19 | 
| 合計ジャッジ時間 | 5,802 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 22 | 
ソースコード
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ItemsTotal[] = new int[10];
        for (int i = 0; i < n; i++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            ItemsTotal[a - 1]++;
            ItemsTotal[b - 1]++;
            ItemsTotal[c - 1]++;
        }
        int powerUp = 0;
        int other = 0;
        for (int i = 0; i < 10; i++) {
            if (ItemsTotal[i] >= 2) {
                powerUp += ItemsTotal[i] / 2;
            }
            other += ItemsTotal[i] % 2;
        }
        int maxPowerUp = (powerUp + other) / 4;
        //int maxPowerUp = other / 4;
        System.out.println(maxPowerUp);
    }
}
            
            
            
        
            
abc