結果

問題 No.387 ハンコ
ユーザー sigma425sigma425
提出日時 2016-07-12 13:42:01
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 861 ms / 5,000 ms
コード長 710 bytes
コンパイル時間 1,464 ms
コンパイル使用メモリ 161,404 KB
実行使用メモリ 7,936 KB
最終ジャッジ日時 2024-04-22 15:22:32
合計ジャッジ時間 9,626 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 861 ms
7,752 KB
testcase_01 AC 852 ms
7,936 KB
testcase_02 AC 648 ms
6,272 KB
testcase_03 AC 656 ms
6,272 KB
testcase_04 AC 273 ms
6,784 KB
testcase_05 AC 544 ms
7,296 KB
testcase_06 AC 715 ms
7,680 KB
testcase_07 AC 651 ms
6,912 KB
testcase_08 AC 662 ms
6,504 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |         scanf("%d",&N);
      |         ~~~~~^~~~~~~~~
main.cpp:20:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   20 |                 scanf("%d",&x);
      |                 ~~~~~^~~~~~~~~
main.cpp:25:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   25 |                 scanf("%d",&x);
      |                 ~~~~~^~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
typedef bitset<200000> BS;
vector<int> vc[100000];
BS ans,is,tmp;
int main(){
	int N;
	scanf("%d",&N);
	rep(i,N){
		int x;
		scanf("%d",&x);
		vc[x-1].pb(i);
	}
	rep(i,N){
		int x;
		scanf("%d",&x);
		is[i]=x;
	}
	rep(i,100000) if(vc[i].size()){
		tmp.reset();
		for(int x:vc[i]) tmp|=is<<x;
		ans^=tmp;
	}
	rep(i,2*N-1){
		if(ans[i]) puts("ODD");
		else puts("EVEN");
	}
}
0