結果
問題 |
No.387 ハンコ
|
ユーザー |
|
提出日時 | 2024-10-13 23:52:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 787 ms / 5,000 ms |
コード長 | 717 bytes |
コンパイル時間 | 1,825 ms |
コンパイル使用メモリ | 170,636 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-13 23:52:36 |
合計ジャッジ時間 | 9,184 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
# include <bits/stdc++.h> using namespace std; typedef long long ll; //# define int long long # define lc u << 1 # define rc u << 1 | 1 # define fi first # define se second const int N = 200005; int n; int a[N]; bitset <N> b; vector <int> pos[N]; bitset <N> ans; signed main () { scanf ("%d", &n); for (int i = 0; i < n; i ++ ) scanf ("%d", &a[i]), pos[a[i]].push_back (i); for (int i = 0, x; i < n; i ++ ) scanf ("%d", &x), b[i] = x; for (int i = 1; i <= 100000; i ++ ) { if (pos[i].empty ()) continue; bitset <N> tmp; tmp.reset (); for (auto j : pos[i]) tmp |= b << j; ans ^= tmp; } for (int i = 0; i < n * 2 - 1; i ++ ) { if (ans[i]) printf ("ODD\n"); else printf ("EVEN\n"); } return 0; }