結果

問題 No.2283 Prohibit Three Consecutive
ユーザー tailstails
提出日時 2023-04-28 22:13:45
言語 cLay
(20240104-1)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 2,742 ms
コンパイル使用メモリ 173,204 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-28 23:44:49
合計ジャッジ時間 3,421 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 8 ms
5,376 KB
testcase_04 AC 8 ms
5,376 KB
testcase_05 AC 9 ms
5,376 KB
testcase_06 AC 9 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 4 ms
5,376 KB
testcase_09 AC 4 ms
5,376 KB
testcase_10 AC 5 ms
5,376 KB
testcase_11 AC 4 ms
5,376 KB
testcase_12 AC 4 ms
5,376 KB
testcase_13 AC 7 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@t;
rep(t){
	ll@n,z=0;
	string@s;
	if(n==2){
		z=s[0]!=s[1]|s[0]=='?'|s[1]=='?';
	}
	if(n>2){
		rep(x,4){
			ll a=1<<x;
			rep(i,n){
				a=((a>>0&1)*3<<0|(a>>1&1)*3<<2|(a>>2&1)*3<<4|(a>>3&1)*3<<6)&((s[i]!='1')*85|(s[i]!='0')*170);
				if(i==n-2){
					a&=x&2?170:85;
				}
				if(i==n-1){
					a&=x&1?170:85;
				}
				a&=~(1<<0|1<<7);
				a=a&15|a>>4;
			}
			z|=a&1<<x;
		}
	}
	wt(z?"Yes":"No");
}
0