結果

問題 No.387 ハンコ
ユーザー 紙ぺーぱー紙ぺーぱー
提出日時 2016-07-02 18:44:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 620 bytes
コンパイル時間 1,795 ms
コンパイル使用メモリ 167,616 KB
実行使用メモリ 14,852 KB
最終ジャッジ日時 2024-04-20 06:06:06
合計ジャッジ時間 14,226 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

}
0