結果

問題 No.29 パワーアップ
コンテスト
ユーザー aitdccd
提出日時 2018-01-02 12:39:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 498 bytes
コンパイル時間 1,091 ms
コンパイル使用メモリ 162,392 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-24 21:04:43
合計ジャッジ時間 1,790 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define REP(i, n) for(int i = 0; i < n; i++)

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;
    vector<int> item(11);
    REP(i, n) {
        int a, b, c;
        cin >> a >> b >> c;
        item[a]++;
        item[b]++;
        item[c]++;
    }

    int ans1 = 0, ans2 = 0;
    REP(i, 11) {
        ans1 += item[i] / 2;
        ans2 += item[i] % 2;
    }
    cout << ans1 + ans2 / 4 << endl;
    return 0;
}
0