結果

問題 No.2063 ±2^k operations (easy)
ユーザー Inoue hayateInoue hayate
提出日時 2022-09-17 04:46:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 87,328 KB
実行使用メモリ 71,620 KB
最終ジャッジ日時 2023-08-23 17:26:19
合計ジャッジ時間 3,078 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,252 KB
testcase_01 AC 70 ms
71,580 KB
testcase_02 AC 71 ms
71,576 KB
testcase_03 AC 71 ms
71,400 KB
testcase_04 AC 72 ms
71,472 KB
testcase_05 AC 73 ms
71,476 KB
testcase_06 AC 71 ms
71,376 KB
testcase_07 AC 69 ms
71,432 KB
testcase_08 AC 71 ms
71,352 KB
testcase_09 AC 69 ms
71,620 KB
testcase_10 AC 71 ms
71,068 KB
testcase_11 AC 72 ms
71,236 KB
testcase_12 AC 69 ms
71,448 KB
testcase_13 AC 71 ms
71,420 KB
testcase_14 AC 70 ms
71,288 KB
testcase_15 AC 73 ms
71,400 KB
testcase_16 AC 70 ms
71,240 KB
testcase_17 AC 72 ms
71,492 KB
testcase_18 AC 72 ms
71,440 KB
testcase_19 AC 73 ms
71,324 KB
testcase_20 AC 73 ms
71,440 KB
testcase_21 AC 73 ms
71,408 KB
testcase_22 AC 70 ms
71,584 KB
testcase_23 AC 68 ms
71,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = input()

if n == "1":
    print("No")
else:
	if n[len(n)-1] == "1":
		n = n[0:len(n)-1] + "0"
		count = n.count("1")
		if count == 1 or n.count("1") == len(n)-1:
			print("Yes")
		else:
			print("No")
	else:
		if n.count("1") == 2:
			print("Yes")
		else:
			index = n.find("0")
			if n[0:index].count("0") == 0 and n.count("1") >= 2 and n[index:len(n)].count("1") == 0:
				print("Yes")
			else:
				print("No")
0