結果

問題 No.680 作れる数
ユーザー H20
提出日時 2020-12-02 10:30:58
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 250 bytes
コンパイル時間 1,894 ms
コンパイル使用メモリ 82,024 KB
実行使用メモリ 89,592 KB
最終ジャッジ日時 2024-09-13 04:08:11
合計ジャッジ時間 4,501 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 TLE * 1 -- * 10
権限があれば一括ダウンロードができます

ソースコード

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