結果

問題 No.29 パワーアップ
ユーザー tsukio
提出日時 2016-03-17 18:00:03
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 445 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 59,736 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-01 08:51:29
合計ジャッジ時間 1,122 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0