結果

問題 No.387 ハンコ
ユーザー vjudge1
提出日時 2024-10-13 14:46:09
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 732 ms / 5,000 ms
コード長 741 bytes
コンパイル時間 878 ms
コンパイル使用メモリ 81,436 KB
実行使用メモリ 8,420 KB
最終ジャッジ日時 2024-10-13 14:46:17
合計ジャッジ時間 8,369 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <set>
#include <map>
#include <algorithm>
#include <vector>
#include <bitset>
#define rep(i, l, r) for (int i = (l); i <= (r); i ++ )
#define per(i, r, l) for (int i = (r); i >= (l); i -- )
using namespace std;
const int N = 1e5 + 1;
int n, a[N], x;
vector<int> vc[N];
bitset<2 * N> b, ans, tmp;
int main() {
    scanf("%d", &n);
    rep(i, 0, n - 1) scanf("%d", &a[i]), vc[a[i]].push_back(i);
    rep(i, 0, n - 1) scanf("%d", &x), b[i] = x;
    rep(i, 0, 100000) {
        if (vc[i].empty()) continue;
        for (auto j: vc[i])
            tmp |= b << j;
        ans ^= tmp;
        tmp = 0;
    }
    rep(i, 0, 2 * n - 2) if (ans[i]) printf("ODD\n"); else printf("EVEN\n");
    return 0;
}
0