結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  lrf141 | 
| 提出日時 | 2016-12-01 14:25:27 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 134 ms / 5,000 ms | 
| コード長 | 724 bytes | 
| コンパイル時間 | 3,210 ms | 
| コンパイル使用メモリ | 76,612 KB | 
| 実行使用メモリ | 46,732 KB | 
| 最終ジャッジ日時 | 2025-10-24 20:59:44 | 
| 合計ジャッジ時間 | 6,771 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
import java.util.Scanner;
public class no29{
    public static void main(String... args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int res = 0,tmp;
        int array[] = new int[10];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < 3; j++){
                tmp = scan.nextInt();
                array[tmp-1]++;
                if(array[tmp-1] == 2){
                    array[tmp-1] = 0;
                    res++;
                }
            }
        }
        tmp = 0;
        for(int i = 0; i < 10; i++)
            tmp += array[i];
        while(4 <= tmp){
            tmp -= 4;
            res++;
        }
        System.out.println(res);
    }
}
            
            
            
        