結果

問題 No.29 パワーアップ
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2019-01-06 16:39:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 538 bytes
コンパイル時間 646 ms
コンパイル使用メモリ 69,828 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-23 23:52:37
合計ジャッジ時間 1,348 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#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