結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  TatsuDX | 
| 提出日時 | 2016-09-08 23:32:34 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 131 ms / 5,000 ms | 
| コード長 | 403 bytes | 
| コンパイル時間 | 3,338 ms | 
| コンパイル使用メモリ | 77,740 KB | 
| 実行使用メモリ | 46,652 KB | 
| 最終ジャッジ日時 | 2025-10-24 20:58:48 | 
| 合計ジャッジ時間 | 7,025 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
import java.util.Scanner;
public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] t = new int[10];
		int n = sc.nextInt() * 3, cnt = 0;
		for (int i = 0; i < n; i++) {
			t[sc.nextInt() - 1]++;
		}
		for (int i = 0; i < 10; i++) {
			while (t[i] >= 2) {
				cnt++;
				n -= 2;
				t[i] -= 2;
			}
		}
		cnt += n / 4;
		System.out.println(cnt);
	}
}
            
            
            
        