結果

問題 No.387 ハンコ
ユーザー yosupotyosupot
提出日時 2016-07-01 21:58:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,413 bytes
コンパイル時間 728 ms
コンパイル使用メモリ 83,400 KB
実行使用メモリ 9,216 KB
最終ジャッジ日時 2024-04-20 05:06:49
合計ジャッジ時間 7,391 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
#include <queue>
#include <cmath>
#include <bitset>
#include <cassert>

using namespace std;
using ll = long long;

namespace StopWatch {
    clock_t st;
    bool f = false;
    void start() {
        f = true;
        st = clock();
    }
    int msecs() {
        assert(f);
        return (clock()-st)*1000 / CLOCKS_PER_SEC;
    }
}

const int MN = 100128;
vector<int> g[MN];
using B = bitset<2*MN>;
int main() {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        int a;
        scanf("%d", &a);
        g[a].push_back(i);
    }
    bool x[n];
    for (int i = 0; i < n; i++) {
        int xx;
        scanf("%d", &xx);
        x[i] = (xx == 1);
    }
    StopWatch::start();
    B mp;
    for (int i = 0; i < n; i++) {
        if (x[i] == 1) {
            mp[i] = true;
        }
    }
    cerr << StopWatch::msecs() << endl;
//    B ans;
    int ans[2*MN] = {};
    for (int i = 0; i < MN; i++) {
        B res;
        for (int d: g[i]) {
            res |= mp << d;
        }
        for (int j = 0; j < 2*MN; j++) {
            ans[i] += (res[i] ? 1 : 0);
        }
//        ans ^= res;
    }
    cerr << StopWatch::msecs() << endl;
    for (int i = 0; i < 2*n-1; i++) {
        if (ans[i] % 2) {
            printf("ODD\n");
        } else {
            printf("EVEN\n");
        }
    }
    return 0;
}
0