結果

問題 No.29 パワーアップ
ユーザー ilplrr
提出日時 2017-07-16 14:11:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 391 bytes
コンパイル時間 598 ms
コンパイル使用メモリ 57,644 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-08 04:15:16
合計ジャッジ時間 1,425 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    int n;
    cin >> n;

    int a, ap[11] = {};
    for(int i=0; i<n*3; i++){
        cin >> a;
        ap[a]++;
    }

    int ans = 0, sum = 0;
    for(int i=1; i<11; i++){
        ans += ap[i]/2;
        sum += ap[i] % 2;
    }
    ans += sum / 4;

    cout << ans << endl;

    return 0;
}
0