結果

問題 No.2283 Prohibit Three Consecutive
ユーザー tails
提出日時 2023-04-28 22:13:45
言語 cLay
(20241019-1)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 2,499 ms
コンパイル使用メモリ 174,236 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 21:09:16
合計ジャッジ時間 3,127 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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