結果

問題 No.2343 (l+r)/2
ユーザー yosupotyosupot
提出日時 2023-07-01 02:50:54
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 319 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 10,642 ms
コンパイル使用メモリ 649,708 KB
実行使用メモリ 6,744 KB
最終ジャッジ日時 2023-09-21 20:30:39
合計ジャッジ時間 12,298 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,344 KB
testcase_01 AC 319 ms
4,568 KB
testcase_02 AC 6 ms
4,344 KB
testcase_03 AC 107 ms
4,612 KB
testcase_04 AC 56 ms
5,848 KB
testcase_05 AC 23 ms
4,336 KB
testcase_06 AC 19 ms
4,340 KB
testcase_07 AC 13 ms
6,372 KB
testcase_08 AC 16 ms
6,656 KB
testcase_09 AC 14 ms
5,624 KB
testcase_10 AC 5 ms
4,336 KB
testcase_11 AC 13 ms
6,576 KB
testcase_12 AC 15 ms
5,928 KB
testcase_13 AC 11 ms
5,628 KB
testcase_14 AC 18 ms
6,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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 = regex(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();
    } 
}
0