結果

問題 No.2343 (l+r)/2
ユーザー yosupotyosupot
提出日時 2023-07-01 02:34:02
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 10,344 ms
コンパイル使用メモリ 646,524 KB
実行使用メモリ 7,196 KB
最終ジャッジ日時 2023-09-21 20:16:19
合計ジャッジ時間 12,969 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,332 KB
testcase_01 AC 271 ms
4,556 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 20 ms
5,896 KB
testcase_05 AC 9 ms
4,332 KB
testcase_06 AC 7 ms
4,332 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 4 ms
4,328 KB
testcase_11 AC 10 ms
6,148 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 11 ms
6,100 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+)*$");
 
    if (s.matchFirst(r)) {
        writeln("Yes");
    } else {
        writeln("No");
    }    
}

void main() {
    int t = to!int(readln.strip);
    foreach (i; 0..t) {
        solve();
    } 
}
0