結果

問題 No.29 パワーアップ
コンテスト
ユーザー h_noson
提出日時 2016-02-15 21:54:22
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 392 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 60,628 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-24 20:56:20
合計ジャッジ時間 1,187 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
    int n;
    int cards[10] = {};
    cin >> n;
    for (int i = 0; i < 3 * n; i++) {
        int x;
        cin >> x;
        cards[x-1]++;
    }
    int ans = 0, rest = 0;
    for (int i = 0; i < 10; i++) {
        ans += cards[i] / 2;
        rest += cards[i] % 2;
    }
    ans += rest / 4;
    cout << ans << endl;
    return 0;
}
0