結果

問題 No.29 パワーアップ
ユーザー OR6107
提出日時 2020-11-02 21:38:26
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 462 bytes
コンパイル時間 1,475 ms
コンパイル使用メモリ 169,444 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-22 08:05:17
合計ジャッジ時間 2,530 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> cnt(11, 0);
    for (int i = 0; i < n; i++) {
        int a, b, c;
        cin >> a >> b >> c;
        cnt.at(a)++;
        cnt.at(b)++;
        cnt.at(c)++;
    }
    int ans = 0;
    int sum = 0;
    for (int i = 1; i < 11; i++) {
        ans += cnt.at(i) / 2;
        sum += cnt.at(i) % 2;
    }
    ans += sum / 4;
    cout << ans << endl;
    return 0;
}
0