結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-10-14 15:11:11 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 405 bytes | 
| コンパイル時間 | 453 ms | 
| コンパイル使用メモリ | 60,788 KB | 
| 実行使用メモリ | 7,720 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:03:17 | 
| 合計ジャッジ時間 | 1,170 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
#include <iostream>
using namespace std;
 
int main(){
	int N;
	cin >> N;
	int items[10];
	for(int i = 0; i < 10; i++){
		items[i] = 0;
	}
	for(int i = 0; i < N * 3; i++){
		int input;
		cin >> input;
		items[input - 1]++;
	}
	int ans = 0;
	int any_item_can_use = 0;
	for(int i = 0; i < 10; i++){
		ans += items[i] / 2;
		any_item_can_use += items[i] % 2;
	}
	cout << ans + any_item_can_use / 4 << endl;
}
            
            
            
        