結果

問題 No.387 ハンコ
ユーザー chocoruskchocorusk
提出日時 2018-11-08 10:35:39
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 853 bytes
コンパイル時間 888 ms
コンパイル使用メモリ 100,612 KB
実行使用メモリ 22,200 KB
最終ジャッジ日時 2024-04-30 22:37:33
合計ジャッジ時間 13,418 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n;
	cin>>n;
	vector<int> w[100001];
	for(int i=0; i<n; i++){
		int a; cin>>a;
		w[a].push_back(i);
	}
	vector<int> v;
	for(int i=0; i<n; i++){
		int b; cin>>b;
		if(b) v.push_back(i);
	}
	bitset<200001> ans;
	for(int i=1; i<=100000; i++){
		if(w[i].empty()) continue;
		bitset<200001> bs, bs0;
		for(auto x:w[i]){
			bs[x]=1;
		}
		for(auto x:v){
			bs0|=(bs<<x);
		}
		ans^=bs0;
	}
	for(int i=0; i<2*n-1; i++){
		if(ans[i]) cout<<"ODD"<<endl;
		else cout<<"EVEN"<<endl;
	}
	return 0;
}
0