結果
| 問題 |
No.387 ハンコ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-11 21:15:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 757 ms / 5,000 ms |
| コード長 | 547 bytes |
| コンパイル時間 | 1,838 ms |
| コンパイル使用メモリ | 171,076 KB |
| 実行使用メモリ | 8,192 KB |
| 最終ジャッジ日時 | 2024-10-11 21:16:00 |
| 合計ジャッジ時間 | 9,391 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 |
ソースコード
# include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100010;
ll n;
vector <ll> col[N];
bitset <N << 1> use, ans;
int main()
{
scanf("%lld", &n);
for (int i = 0, a; i < n; i++) scanf("%d", &a), col[a].push_back(i);
for (int i = 0, b; i < n; i++) scanf("%lld", &b), use[i] = b;
for (int i = 0; i < N; i++)
{
if (col[i].empty()) continue;
bitset <N << 1> tmp;
for (auto x : col[i]) tmp |= (use << x);
ans ^= tmp;
}
for (int i = 0; i < (n << 1) - 1; i++) printf(ans[i] ? "ODD\n" : "EVEN\n");
return 0;
}