結果

問題 No.387 ハンコ
ユーザー 👑 kmjpkmjp
提出日時 2016-07-01 23:23:35
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,013 ms / 5,000 ms
コード長 1,083 bytes
コンパイル時間 1,457 ms
コンパイル使用メモリ 148,804 KB
実行使用メモリ 8,540 KB
最終ジャッジ日時 2023-08-02 06:14:37
合計ジャッジ時間 10,363 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,012 ms
8,540 KB
testcase_01 AC 1,013 ms
8,272 KB
testcase_02 AC 737 ms
6,548 KB
testcase_03 AC 740 ms
6,392 KB
testcase_04 AC 323 ms
6,776 KB
testcase_05 AC 633 ms
7,528 KB
testcase_06 AC 849 ms
8,056 KB
testcase_07 AC 727 ms
6,976 KB
testcase_08 AC 744 ms
6,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
vector<int> V[101010];
int B[101010];
bitset<202020> AS;
bitset<202020> BS;
bitset<202020> TS;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	FOR(i,N) {
		cin>>x;
		V[x].push_back(i);
	}
	FOR(i,N) {
		cin>>B[i];
		if(B[i]) BS[i]=1;
	}
	
	FOR(i,101000) if(V[i].size()) {
		bitset<202020> T;
		FORR(v,V[i]) T |= BS<<v;
		TS ^= T;
	}
	FOR(i,2*N-1) {
		if(TS[i]) _P("ODD\n");
		else _P("EVEN\n");
	}
		
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}
0