結果

問題 No.29 パワーアップ
ユーザー Kaz_nl
提出日時 2017-08-19 12:34:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 392 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 54,104 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-14 15:46:23
合計ジャッジ時間 1,136 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int n, t, item, ans, a[11];

int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> t;
      a[t]++;
    }
  }
  for (int i = 1; i <= 10; i++) {
    if (a[i] / 2) {
      ans += a[i] / 2;
      item += a[i] % 2;
    } else if (a[i]) {
      item++;
    }
  }
  ans += item / 4;
  cout << ans << endl;
}
0