結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  chiho_miyako | 
| 提出日時 | 2015-04-07 16:08:21 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 148 ms / 5,000 ms | 
| コード長 | 669 bytes | 
| コンパイル時間 | 2,291 ms | 
| コンパイル使用メモリ | 77,684 KB | 
| 実行使用メモリ | 46,728 KB | 
| 最終ジャッジ日時 | 2025-10-24 20:52:11 | 
| 合計ジャッジ時間 | 6,244 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int n = koko.nextInt();
        int[] b = new int[n*3];
        int[] item = new int[10];
        for(int i=0; i<n*3; i++){
            b[i] = koko.nextInt();
            item[b[i]-1]++;
        }
        int amari = 0;
        int count = 0;
        int m;
        for(int i=0; i<10;i++){
            m = item[i]%2;
            count = count + ((item[i]-m)/2);
            amari = amari + m;
        }
        int mm = amari%4;
        count = count + ((amari-mm)/4);
        System.out.println(count);
    }
}
            
            
            
        