結果

問題 No.29 パワーアップ
ユーザー トミートミー
提出日時 2024-03-27 03:51:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 703 bytes
コンパイル時間 2,092 ms
コンパイル使用メモリ 203,440 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-27 03:51:22
合計ジャッジ時間 3,131 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 1 ms
6,676 KB
testcase_15 AC 1 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 2 ms
6,676 KB
testcase_21 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
    int n;
    cin >> n;
    vector<int> v;
    int d[11];
    int point = 0;
    int sum = 0;
    for (int i = 0; i < 11; i++)
    {
        d[i] = 0;
    }
    for (int i = 0; i < n; i++)
    {
        int a, b, c;
        cin >>a>> b >> c;
        v.push_back(a);
        v.push_back(b);
        v.push_back(c);
    }
    for (auto &i : v)
        d[i]++;
    for (auto &i : d)
    {
        point += i / 2;
        i %= 2;
    }
    // cout<<point<<endl;
    // for(auto &i:v){
    //     cout<<i<<endl;
    // }
    for (auto &i : d)
    {
        sum += i;
    }
    point += sum / 4;
    cout << point << endl;
    // system("pause");
}
0