結果

問題 No.29 パワーアップ
コンテスト
ユーザー KKT89
提出日時 2020-03-06 00:47:48
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 319µs
コード長 435 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 528 ms
コンパイル使用メモリ 104,216 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-15 22:26:16
合計ジャッジ時間 1,754 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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