結果

問題 No.387 ハンコ
ユーザー kimiyukikimiyuki
提出日時 2016-07-02 02:39:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 716 bytes
コンパイル時間 662 ms
コンパイル使用メモリ 76,372 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2024-04-20 06:49:31
合計ジャッジ時間 3,412 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <bitset>
#include <vector>
#include <map>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
using namespace std;
#define N 5000
#define L (2*N-1)
int main() {
    // input
    int n; scanf("%d", &n);
    map<int,vector<int> > a;
    repeat (i,n) {
        int it; scanf("%d", &it);
        a[it].push_back(i);
    }
    bitset<L> b;
    repeat (i,n) {
        int it; scanf("%d", &it);
        b[i] = it;
    }
    // compute
    bitset<L> c;
    for (auto it : a) {
        bitset<L> d;
        for (int i : it.second) {
            d |= b << i;
        }
        c ^= d;
    }
    // output
    repeat (i,2*n-1) {
        printf("%s\n", c[i] ? "ODD" : "EVEN");
    }
    return 0;
}
0