結果

問題 No.29 パワーアップ
ユーザー legosuke
提出日時 2017-10-10 01:24:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 380 bytes
コンパイル時間 1,381 ms
コンパイル使用メモリ 164,704 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 07:14:02
合計ジャッジ時間 1,964 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(void) {
  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, rem = 0;
  for (auto i : mp) {
    ans += i.second / 2;
    rem += i.second % 2;
  }
  ans += rem / 4;

  cout << ans << endl;

  return 0;
}
0