結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-03-17 18:00:03 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 445 bytes | 
| コンパイル時間 | 429 ms | 
| コンパイル使用メモリ | 65,268 KB | 
| 実行使用メモリ | 7,716 KB | 
| 最終ジャッジ日時 | 2025-10-24 20:56:39 | 
| 合計ジャッジ時間 | 1,323 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main() {
	int n;
	cin >> n;
	vector<int> count_items(10 + 1, 0);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 3; j++) {
			int item;
			cin >> item;
			count_items[item]++;
		}
	}
	int ans = 0;
	int sum = 0;
	for (int i = 1; i < count_items.size(); i++) {
		ans += count_items[i] / 2;
		sum += count_items[i] % 2;
	}
	ans += sum / 4;
	cout << ans << endl;
	return 0;
}
            
            
            
        