結果

問題 No.1355 AND OR GAME
ユーザー tailstails
提出日時 2021-01-20 11:12:05
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 580 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 30,312 KB
実行使用メモリ 7,208 KB
最終ジャッジ日時 2023-08-24 13:42:27
合計ジャッジ時間 8,914 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 0 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 0 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 0 ms
4,380 KB
testcase_09 AC 0 ms
4,384 KB
testcase_10 AC 0 ms
4,376 KB
testcase_11 AC 1 ms
4,500 KB
testcase_12 AC 0 ms
4,380 KB
testcase_13 AC 0 ms
4,504 KB
testcase_14 AC 0 ms
4,380 KB
testcase_15 AC 0 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 0 ms
4,384 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 0 ms
4,380 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 0 ms
4,384 KB
testcase_29 AC 0 ms
4,376 KB
testcase_30 AC 0 ms
4,380 KB
testcase_31 AC 0 ms
4,376 KB
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 1 ms
4,376 KB
testcase_35 AC 7 ms
7,160 KB
testcase_36 AC 6 ms
6,716 KB
testcase_37 AC 0 ms
4,380 KB
testcase_38 AC 6 ms
7,128 KB
testcase_39 AC 2 ms
4,500 KB
testcase_40 AC 3 ms
4,376 KB
testcase_41 AC 6 ms
7,176 KB
testcase_42 AC 6 ms
7,044 KB
testcase_43 AC 3 ms
4,952 KB
testcase_44 AC 1 ms
4,376 KB
testcase_45 AC 6 ms
7,180 KB
testcase_46 AC 3 ms
4,384 KB
testcase_47 AC 6 ms
7,148 KB
testcase_48 AC 5 ms
5,424 KB
testcase_49 AC 7 ms
7,092 KB
testcase_50 AC 0 ms
4,380 KB
testcase_51 AC 3 ms
4,380 KB
testcase_52 AC 6 ms
6,512 KB
testcase_53 AC 4 ms
4,964 KB
testcase_54 AC 6 ms
7,164 KB
testcase_55 AC 6 ms
6,788 KB
testcase_56 AC 6 ms
6,716 KB
testcase_57 AC 4 ms
5,432 KB
testcase_58 AC 1 ms
4,376 KB
testcase_59 AC 0 ms
4,380 KB
testcase_60 AC 4 ms
5,260 KB
testcase_61 AC 0 ms
4,380 KB
testcase_62 AC 3 ms
4,508 KB
testcase_63 AC 6 ms
7,112 KB
testcase_64 AC 6 ms
6,748 KB
testcase_65 AC 1 ms
4,564 KB
testcase_66 AC 2 ms
4,380 KB
testcase_67 AC 2 ms
4,380 KB
testcase_68 AC 2 ms
4,380 KB
testcase_69 AC 1 ms
4,376 KB
testcase_70 AC 3 ms
4,380 KB
testcase_71 AC 6 ms
7,176 KB
testcase_72 AC 6 ms
7,152 KB
testcase_73 AC 6 ms
7,044 KB
testcase_74 AC 6 ms
7,032 KB
testcase_75 AC 6 ms
7,144 KB
testcase_76 AC 6 ms
7,208 KB
testcase_77 AC 6 ms
7,100 KB
testcase_78 AC 0 ms
4,380 KB
testcase_79 AC 1 ms
4,380 KB
testcase_80 AC 6 ms
7,152 KB
testcase_81 AC 6 ms
7,092 KB
testcase_82 AC 6 ms
7,036 KB
testcase_83 AC 5 ms
6,752 KB
testcase_84 AC 2 ms
4,380 KB
testcase_85 AC 4 ms
4,476 KB
testcase_86 AC 3 ms
4,380 KB
testcase_87 AC 3 ms
4,376 KB
testcase_88 AC 1 ms
4,380 KB
testcase_89 AC 1 ms
4,384 KB
testcase_90 AC 6 ms
5,144 KB
testcase_91 AC 1 ms
4,376 KB
testcase_92 AC 1 ms
4,380 KB
testcase_93 AC 5 ms
4,560 KB
testcase_94 AC 3 ms
4,376 KB
testcase_95 AC 3 ms
4,380 KB
testcase_96 AC 2 ms
4,380 KB
testcase_97 AC 1 ms
4,380 KB
testcase_98 AC 6 ms
5,272 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:11:1: 警告: 戻り値の型をデフォルトの ‘int’ にします [-Wimplicit-int]
   11 | main(){
      | ^~~~
main.c: 関数 ‘main’ 内:
main.c:34:25: 警告: 関数 ‘write’ の暗黙的な宣言です [-Wimplicit-function-declaration]
   34 |         if(wbuf[0]!=51) write(1,"-1",2);
      |                         ^~~~~
main.c:36:9: 警告: implicit declaration of function ‘_exit’; did you mean ‘_Exit’? [-Wimplicit-function-declaration]
   36 |         _exit(0);
      |         ^~~~~
      |         _Exit

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")

char*mmap();

#define RD(v) v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;}

long a[200001];
char wbuf[400002];

main(){
	int n;
	long x,y;
	char*rp=mmap(0l,1l<<28,1,2,0,0ll);
	RD(n);
	RD(x);
	RD(y);
	a[0]=x;
	for(int i=0;i<n;++i){
		long t;
		RD(t);
		a[i+1]=t;
	}
	long y0=y,y1=y;
	for(int i=n+1;i--;){
		long t=a[i];
		int s=(y1&~t?0:1)+(~y0&t?0:2);
		if(s==0) break;
		if(s&2) y1&=~t;
		if(s&1) y0|=~t;
		wbuf[i*2+0]=s+48;
		wbuf[i*2+1]=32;
	}
	if(wbuf[0]!=51) write(1,"-1",2);
	else write(1,wbuf+2,n*2);
	_exit(0);
}
0