結果
| 問題 | No.2343 (l+r)/2 |
| コンテスト | |
| ユーザー |
yosupot
|
| 提出日時 | 2023-07-01 02:52:29 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
AC
|
| 実行時間 | 358 ms / 2,000 ms |
| + 333µs | |
| コード長 | 432 bytes |
| 記録 | |
| コンパイル時間 | 11,778 ms |
| コンパイル使用メモリ | 293,192 KB |
| 実行使用メモリ | 7,808 KB |
| 最終ジャッジ日時 | 2026-08-11 08:45:55 |
| 合計ジャッジ時間 | 13,488 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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();
}
}
yosupot