結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-03-06 00:47:48 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 435 bytes | 
| コンパイル時間 | 805 ms | 
| コンパイル使用メモリ | 86,988 KB | 
| 実行使用メモリ | 7,716 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:13:16 | 
| 合計ジャッジ時間 | 1,361 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
typedef long long int ll;
int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	map<int,int> mp;
	for(int i=0;i<n;i++){
		int a,b,c; cin >> a >> b >> c;
		mp[a]++; mp[b]++; mp[c]++;
	}
	int ans=0;
	int cnt=0;
	for(auto p:mp){
		ans+=p.second/2;
		cnt+=p.second%2;
	}
	cout << ans+cnt/4 << endl;
}
            
            
            
        