結果

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

テストケース

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