結果
| 問題 |
No.387 ハンコ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-15 21:15:34 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 684 bytes |
| コンパイル時間 | 2,052 ms |
| コンパイル使用メモリ | 197,688 KB |
| 最終ジャッジ日時 | 2025-02-24 19:52:47 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 8 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
bitset<N> bs,bst[N],ansb;
vector<int> v[N];
int n,a[N],b[N];
int main() {
// freopen("stamp.in","r",stdin);
// freopen("stamp.out","w",stdout);
cin>>n;
for(int i=1; i<=n; i++) cin>>a[i],v[a[i]].push_back(i);
for(int i=1; i<=n; i++) cin>>b[i];
for(int i=1; i<=n; i++) {
if(!v[i].size()) continue;
for(int j=0; j<v[i].size(); j++) bs[v[i][j]]=true;
for(int j=1; j<=n; j++) {
if(b[j]) bst[i]|=bs;
bs<<=1;
}
for(int j=0; j<v[i].size(); j++) bs[v[i][j]+n-1]=false;
}
for(int i=1; i<=n; i++) ansb^=bst[i];
for(int i=1; i<=2*n-1; i++)
if(ansb[i]) printf("ODD\n");
else printf("EVEN\n");
return 0;
}