結果

問題 No.387 ハンコ
ユーザー kimiyukikimiyuki
提出日時 2016-07-02 02:41:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 930 ms / 5,000 ms
コード長 718 bytes
コンパイル時間 687 ms
コンパイル使用メモリ 75,680 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-20 06:50:14
合計ジャッジ時間 8,893 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 930 ms
10,624 KB
testcase_01 AC 930 ms
10,752 KB
testcase_02 AC 705 ms
6,944 KB
testcase_03 AC 706 ms
6,944 KB
testcase_04 AC 298 ms
6,940 KB
testcase_05 AC 586 ms
8,704 KB
testcase_06 AC 788 ms
9,856 KB
testcase_07 AC 714 ms
6,940 KB
testcase_08 AC 713 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

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 100000
#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