結果
問題 | No.2343 (l+r)/2 |
ユーザー |
![]() |
提出日時 | 2023-07-01 02:52:29 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 226 ms / 2,000 ms |
コード長 | 432 bytes |
コンパイル時間 | 15,778 ms |
コンパイル使用メモリ | 333,476 KB |
実行使用メモリ | 8,900 KB |
最終ジャッジ日時 | 2024-07-07 14:00:43 |
合計ジャッジ時間 | 16,778 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 14 |
ソースコード
import std.stdio, std.string, std.regex, std.conv; void solve() { int n = to!int(readln.strip); string s = readln.strip.split.join; auto r = ctRegex!(r"^((0+1+|1+0+)*)((0+1+0+1+0+1+0+1+0+)|(1+0+1+0+1+0+1+0+1+)|)$"); if (s.matchFirst(r)) { writeln("Yes"); } else { writeln("No"); } } void main() { int t = to!int(readln.strip); foreach (i; 0..t) { solve(); } }