結果

問題 No.680 作れる数
ユーザー kohei2019kohei2019
提出日時 2022-03-12 02:23:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 315 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 318,056 KB
最終ジャッジ日時 2023-10-14 12:25:53
合計ジャッジ時間 18,732 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,170 ms
316,088 KB
testcase_01 AC 802 ms
316,288 KB
testcase_02 AC 852 ms
316,616 KB
testcase_03 AC 795 ms
316,528 KB
testcase_04 AC 801 ms
316,096 KB
testcase_05 AC 803 ms
316,552 KB
testcase_06 AC 798 ms
316,132 KB
testcase_07 AC 802 ms
316,256 KB
testcase_08 AC 799 ms
316,224 KB
testcase_09 AC 813 ms
316,276 KB
testcase_10 AC 798 ms
316,280 KB
testcase_11 AC 796 ms
316,532 KB
testcase_12 AC 816 ms
316,148 KB
testcase_13 WA -
testcase_14 AC 802 ms
318,012 KB
testcase_15 WA -
testcase_16 AC 800 ms
316,924 KB
testcase_17 WA -
testcase_18 AC 811 ms
316,300 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
d = 22
ls = set()
def dfs(t,s,dep):
    if dep == d:
        ls.add(s)
        return
    ls.add(s)
    dfs(2*t, s+2*t, dep+1)
    dfs(2*t+1, s+2*t+1, dep+1)
dfs(0,0,0)
ls = list(ls)
ls.sort()
if N in ls:
    print('YES')
else:
    if ls[-1] < N:
        print('YES')
    else:
        print('NO')
0