結果

問題 No.2343 (l+r)/2
ユーザー とろちゃとろちゃ
提出日時 2023-06-09 21:10:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 419 bytes
コンパイル時間 129 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 9,584 KB
最終ジャッジ日時 2023-08-30 12:40:39
合計ジャッジ時間 2,939 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,796 KB
testcase_01 AC 1,444 ms
7,924 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 20 ms
8,980 KB
testcase_05 AC 18 ms
8,676 KB
testcase_06 AC 18 ms
8,392 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 18 ms
8,596 KB
testcase_11 AC 20 ms
9,584 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 21 ms
9,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for _ in range(T):
    N = int(input())
    A = "".join(input().split())
    cnt1 = A.count("1")
    cnt0 = A.count("0")
    if cnt1 > cnt0:
        if cnt1 - cnt0 <= A.count("11"):
            print("Yes")
        else:
            print("No")
    elif cnt1 < cnt0:
        if cnt0 - cnt1 <= A.count("00"):
            print("Yes")
        else:
            print("No")
    else:
        print("Yes")
0