結果

問題 No.387 ハンコ
ユーザー mayoko_mayoko_
提出日時 2016-07-02 00:18:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,345 bytes
コンパイル時間 939 ms
コンパイル使用メモリ 104,228 KB
実行使用メモリ 14,760 KB
最終ジャッジ日時 2024-04-20 06:26:53
合計ジャッジ時間 13,495 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
//#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
//#include<list>
#include<queue>
#include<deque>
#include<algorithm>
//#include<numeric>
#include<utility>
//#include<memory>
#include<functional>
#include<cassert>
#include<set>
#include<stack>
#include<random>
#include<bitset>

const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, -1, 0, 1};
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;

const int MAXA = 100001;
const int MAXN = 100001;
vector<int> pos[MAXA];
int B[MAXN];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    for (int i = 0; i < N; i++) {
        int a;
        cin >> a;
        pos[a].push_back(i);
    }
    for (int i = 0; i < N; i++)
        cin >> B[i];
    bitset<2*MAXN> ans;
    for (int i = 0; i < MAXA; i++) if (pos[i].size()) {
        bitset<2*MAXN> memo;
        for (int j = 0; j < N; j++) if (B[j]) {
            for (int to : pos[i])
            memo.set(j+to); 
        }
        ans ^= memo;
    }
    for (int i = 0; i < 2*N-1; i++) {
        if (ans[i]) cout << "ODD" << endl;
        else cout << "EVEN" << endl;
    }
    return 0;
}
0