結果
問題 | No.29 パワーアップ |
ユーザー |
|
提出日時 | 2020-03-06 00:47:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 435 bytes |
コンパイル時間 | 886 ms |
コンパイル使用メモリ | 85,140 KB |
最終ジャッジ日時 | 2025-01-09 04:36:28 |
ジャッジサーバーID (参考情報) |
judge2 / 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; }