結果
| 問題 |
No.387 ハンコ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-07-02 02:41:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 921 ms / 5,000 ms |
| コード長 | 718 bytes |
| コンパイル時間 | 730 ms |
| コンパイル使用メモリ | 75,540 KB |
| 実行使用メモリ | 10,112 KB |
| 最終ジャッジ日時 | 2024-10-12 01:57:57 |
| 合計ジャッジ時間 | 8,689 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 |
ソースコード
#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;
}