結果

問題 No.680 作れる数
ユーザー 👑 H20H20
提出日時 2020-12-02 10:30:58
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 250 bytes
コンパイル時間 976 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 77,280 KB
最終ジャッジ日時 2023-10-11 04:48:44
合計ジャッジ時間 5,050 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,352 KB
testcase_01 AC 70 ms
71,388 KB
testcase_02 AC 71 ms
71,588 KB
testcase_03 AC 71 ms
71,340 KB
testcase_04 AC 73 ms
71,332 KB
testcase_05 AC 73 ms
71,496 KB
testcase_06 AC 79 ms
75,556 KB
testcase_07 AC 98 ms
76,884 KB
testcase_08 AC 101 ms
77,280 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10 ** 9)

N = int(input())

def dfs(s,t):
    if N==s:
        return True
    if N<s:
        return False
    return dfs(s+t*2,t*2) or dfs(s+t*2+1,t*2+1)


if dfs(1,1) or N==0:
    print('YES')
else:
    print('NO')
0