結果

問題 No.29 パワーアップ
ユーザー trineutron
提出日時 2020-02-11 18:33:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 394 bytes
コンパイル時間 1,976 ms
コンパイル使用メモリ 193,504 KB
最終ジャッジ日時 2025-01-08 23:41:56
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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