結果

問題 No.29 パワーアップ
コンテスト
ユーザー toshiro_yanagi
提出日時 2019-01-06 16:39:05
言語 C++14
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 404µs
コード長 538 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 363 ms
コンパイル使用メモリ 78,592 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-15 22:11:01
合計ジャッジ時間 1,612 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
using namespace std;

int n;
int cnt = 0;
vector<bool> items(10);

int main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            int k;
            cin >> k;
            k--;

            if (items[k] == true)
            {
                cnt++;
            }
            items[k] = items[k] ^ 1;
        }
    }
    int etc = 0;
    for (int i = 0; i < items.size(); i++)
    {
        etc += items[i];
    }
    cout << cnt + etc / 4;
}
0