結果

問題 No.2063 ±2^k operations (easy)
ユーザー ニックネームニックネーム
提出日時 2022-09-02 21:26:58
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 195 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,540 KB
実行使用メモリ 9,400 KB
最終ジャッジ日時 2023-08-10 03:18:03
合計ジャッジ時間 1,599 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,392 KB
testcase_01 AC 19 ms
8,408 KB
testcase_02 AC 19 ms
8,340 KB
testcase_03 AC 18 ms
8,404 KB
testcase_04 AC 18 ms
8,408 KB
testcase_05 AC 19 ms
8,528 KB
testcase_06 AC 19 ms
8,340 KB
testcase_07 AC 18 ms
8,384 KB
testcase_08 AC 18 ms
8,356 KB
testcase_09 AC 18 ms
8,340 KB
testcase_10 AC 19 ms
8,408 KB
testcase_11 AC 19 ms
8,376 KB
testcase_12 AC 18 ms
8,376 KB
testcase_13 AC 18 ms
8,428 KB
testcase_14 AC 19 ms
8,400 KB
testcase_15 AC 18 ms
8,320 KB
testcase_16 AC 19 ms
8,456 KB
testcase_17 AC 31 ms
9,284 KB
testcase_18 AC 20 ms
8,952 KB
testcase_19 AC 25 ms
9,028 KB
testcase_20 AC 31 ms
9,400 KB
testcase_21 AC 26 ms
9,324 KB
testcase_22 AC 21 ms
8,964 KB
testcase_23 AC 21 ms
9,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n = input()
dq = deque(n)
while dq[0] == "0": dq.popleft()
while dq[-1] == "0": dq.pop()
print("Yes" if n.count("1") == 2 or len(dq) > 1 and "0" not in dq else "No")
0