結果

問題 No.29 パワーアップ
コンテスト
ユーザー trineutron
提出日時 2020-02-11 18:33:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 394 bytes
コンパイル時間 1,574 ms
コンパイル使用メモリ 195,768 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-10-24 21:13:12
合計ジャッジ時間 2,296 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> items(10);
    for (int i = 0; i < 3 * n; i++) {
        int a;
        cin >> a;
        items.at(a - 1)++;
    }
    int ans = 0, odd = 0;
    for (int i = 0; i < 10; i++) {
        ans += items.at(i) / 2;
        odd += items.at(i) % 2;
    }
    ans += odd / 4;
    cout << ans << endl;
}
0