結果

問題 No.680 作れる数
ユーザー ayaoniayaoni
提出日時 2020-11-29 00:56:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 445 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 71,612 KB
最終ジャッジ日時 2023-10-11 02:06:31
合計ジャッジ時間 3,330 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,592 KB
testcase_01 AC 69 ms
71,444 KB
testcase_02 AC 73 ms
71,488 KB
testcase_03 AC 72 ms
71,612 KB
testcase_04 AC 71 ms
71,316 KB
testcase_05 AC 72 ms
71,428 KB
testcase_06 AC 72 ms
71,116 KB
testcase_07 AC 71 ms
71,324 KB
testcase_08 AC 73 ms
71,488 KB
testcase_09 AC 72 ms
71,312 KB
testcase_10 AC 70 ms
71,444 KB
testcase_11 AC 69 ms
71,452 KB
testcase_12 AC 70 ms
71,320 KB
testcase_13 AC 71 ms
71,408 KB
testcase_14 AC 72 ms
71,528 KB
testcase_15 AC 71 ms
71,536 KB
testcase_16 AC 71 ms
71,116 KB
testcase_17 AC 71 ms
71,260 KB
testcase_18 AC 70 ms
71,596 KB
testcase_19 AC 68 ms
71,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def I(): return int(sys.stdin.readline().rstrip())


N = I()
a = N//2
b = (2**29*(N+30))//(2**30-1)

for i in range(a,b+1):
    x = 0
    for _ in range(30):
        x += i
        i //= 2
    if x == N:
        print('YES')
        break
else:
    print('NO')
0