結果

問題 No.29 パワーアップ
ユーザー 東前頭十一枚目
提出日時 2020-03-13 10:17:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 338 bytes
コンパイル時間 1,872 ms
コンパイル使用メモリ 172,096 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-21 16:23:42
合計ジャッジ時間 3,171 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main() {
	int n; cin >> n;
	map<int, int> mp;
	for(int i = 0; i < n; ++i) {
		for(int j = 0; j < 3; ++j) {
			int a; cin >> a;
			mp[a]++;
		}
	}
	int sum = 0;
	int ans = 0;
	for(auto e : mp) {
		ans += e.second / 2;
		sum += e.second % 2;
	}
	cout << ans + sum / 4 << '\n';
	return 0;
}
0