結果

問題 No.680 作れる数
ユーザー rlangevinrlangevin
提出日時 2023-10-05 08:47:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 203 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 87,344 KB
実行使用メモリ 71,672 KB
最終ジャッジ日時 2023-10-05 08:47:54
合計ジャッジ時間 3,102 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,336 KB
testcase_01 AC 74 ms
71,196 KB
testcase_02 AC 71 ms
71,376 KB
testcase_03 AC 80 ms
71,464 KB
testcase_04 AC 70 ms
71,364 KB
testcase_05 WA -
testcase_06 AC 73 ms
71,340 KB
testcase_07 WA -
testcase_08 AC 70 ms
71,616 KB
testcase_09 AC 69 ms
71,428 KB
testcase_10 AC 69 ms
71,528 KB
testcase_11 AC 74 ms
71,596 KB
testcase_12 AC 69 ms
71,200 KB
testcase_13 WA -
testcase_14 AC 71 ms
71,360 KB
testcase_15 WA -
testcase_16 AC 94 ms
71,540 KB
testcase_17 WA -
testcase_18 AC 70 ms
71,612 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
if N == 0:
    print("YES")
    exit()

mi, ma = 0, 0
for k in range(60):
    mi += 2 ** k
    ma += 2 ** (k+1) - 1
    if mi <= N <= ma:
        print("YES")
        exit()

print("NO")
0