結果

問題 No.2063 ±2^k operations (easy)
ユーザー lloyzlloyz
提出日時 2022-09-02 21:52:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,296 KB
実行使用メモリ 84,160 KB
最終ジャッジ日時 2023-08-10 03:50:44
合計ジャッジ時間 3,079 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,452 KB
testcase_01 AC 68 ms
71,144 KB
testcase_02 AC 67 ms
71,484 KB
testcase_03 AC 67 ms
71,640 KB
testcase_04 AC 69 ms
71,076 KB
testcase_05 AC 68 ms
71,364 KB
testcase_06 AC 68 ms
71,452 KB
testcase_07 AC 69 ms
71,368 KB
testcase_08 AC 69 ms
71,576 KB
testcase_09 AC 72 ms
71,336 KB
testcase_10 AC 70 ms
71,604 KB
testcase_11 AC 68 ms
71,112 KB
testcase_12 AC 70 ms
71,532 KB
testcase_13 AC 69 ms
71,616 KB
testcase_14 AC 68 ms
71,468 KB
testcase_15 AC 70 ms
71,332 KB
testcase_16 AC 70 ms
71,276 KB
testcase_17 AC 81 ms
83,788 KB
testcase_18 AC 82 ms
83,892 KB
testcase_19 AC 81 ms
82,140 KB
testcase_20 AC 83 ms
83,812 KB
testcase_21 AC 83 ms
83,224 KB
testcase_22 AC 83 ms
84,160 KB
testcase_23 AC 84 ms
84,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L = list(map(int, list(input())))

n = len(L)
cnt = 0
seq_flag = False
for i in range(n):
    if L[i] == 1:
        if i == 0:
            cnt += 1
        else:
            if L[i] == L[i - 1]:
                seq_flag = True
            else:
                cnt += 1
if (seq_flag and cnt == 1) or (not seq_flag and cnt == 2):
    print("Yes")
else:
    print("No")
0