結果

問題 No.387 ハンコ
ユーザー 紙ぺーぱー紙ぺーぱー
提出日時 2016-07-02 19:08:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,115 ms / 5,000 ms
コード長 583 bytes
コンパイル時間 1,898 ms
コンパイル使用メモリ 168,000 KB
実行使用メモリ 8,064 KB
最終ジャッジ日時 2024-04-20 06:08:22
合計ジャッジ時間 11,724 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,115 ms
7,888 KB
testcase_01 AC 1,079 ms
8,064 KB
testcase_02 AC 963 ms
6,944 KB
testcase_03 AC 959 ms
6,944 KB
testcase_04 AC 330 ms
6,944 KB
testcase_05 AC 676 ms
7,380 KB
testcase_06 AC 935 ms
7,936 KB
testcase_07 AC 924 ms
6,944 KB
testcase_08 AC 924 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

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