結果

問題 No.387 ハンコ
ユーザー 紙ぺーぱー
提出日時 2016-07-02 19:08:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1,205 ms / 5,000 ms
コード長 583 bytes
コンパイル時間 1,667 ms
コンパイル使用メモリ 172,200 KB
実行使用メモリ 7,808 KB
最終ジャッジ日時 2024-10-12 01:13:30
合計ジャッジ時間 12,140 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
int n;
vector<int> a[100000];
int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        int x;cin>>x;
        a[x-1].emplace_back(i);
    }
    bitset<200000> b;
    for(int i=0;i<n;i++){
        int x;cin>>x;
        if(x)b.set(i);
    }
    bitset<200000> ans;
    for(int i=0;i<100000;i++){
        if(!a[i].size())continue;
        bitset<200000>dp;
        for(auto x: a[i])dp|=b<<x;
        ans^=dp;
    }
    for(int i=0;i<2*n-1;i++)
        if(ans[i])cout<<"ODD"<<endl;
        else cout<<"EVEN"<<endl;

}
0