結果
| 問題 |
No.387 ハンコ
|
| コンテスト | |
| ユーザー |
yosupot
|
| 提出日時 | 2016-07-01 21:58:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,413 bytes |
| コンパイル時間 | 869 ms |
| コンパイル使用メモリ | 82,180 KB |
| 実行使用メモリ | 9,088 KB |
| 最終ジャッジ日時 | 2024-10-12 00:06:42 |
| 合計ジャッジ時間 | 8,575 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 9 |
ソースコード
#include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
#include <queue>
#include <cmath>
#include <bitset>
#include <cassert>
using namespace std;
using ll = long long;
namespace StopWatch {
clock_t st;
bool f = false;
void start() {
f = true;
st = clock();
}
int msecs() {
assert(f);
return (clock()-st)*1000 / CLOCKS_PER_SEC;
}
}
const int MN = 100128;
vector<int> g[MN];
using B = bitset<2*MN>;
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
int a;
scanf("%d", &a);
g[a].push_back(i);
}
bool x[n];
for (int i = 0; i < n; i++) {
int xx;
scanf("%d", &xx);
x[i] = (xx == 1);
}
StopWatch::start();
B mp;
for (int i = 0; i < n; i++) {
if (x[i] == 1) {
mp[i] = true;
}
}
cerr << StopWatch::msecs() << endl;
// B ans;
int ans[2*MN] = {};
for (int i = 0; i < MN; i++) {
B res;
for (int d: g[i]) {
res |= mp << d;
}
for (int j = 0; j < 2*MN; j++) {
ans[i] += (res[i] ? 1 : 0);
}
// ans ^= res;
}
cerr << StopWatch::msecs() << endl;
for (int i = 0; i < 2*n-1; i++) {
if (ans[i] % 2) {
printf("ODD\n");
} else {
printf("EVEN\n");
}
}
return 0;
}
yosupot