結果
問題 | No.387 ハンコ |
ユーザー |
|
提出日時 | 2017-11-10 13:15:33 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,452 ms / 5,000 ms |
コード長 | 618 bytes |
コンパイル時間 | 2,308 ms |
コンパイル使用メモリ | 198,520 KB |
最終ジャッジ日時 | 2025-01-05 03:53:57 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;#define REP(i,n) for (int i=0;i<(n);i++)#define REP2(i,m,n) for (int i=m;i<(n);i++)int N;int A[101010];int B[101010];bitset<202020> bs;bitset<202020> ans;bitset<202020> tmp;vector<int> rev[101010];int main() {cin >> N;REP(i, N) cin >> A[i];REP(i, N) cin >> B[i];REP(i, N) rev[A[i]].push_back(i);REP(i, N) bs[i] = B[i] == 1;REP(c, 101010) {tmp = 0;for (auto i: rev[c])tmp |= (bs << i);ans ^= tmp;}REP(i, 2*N-1) cout << (ans[i] ? "ODD" : "EVEN") << endl;}