結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 441 ms
271,896 KB
testcase_01 AC 440 ms
271,488 KB
testcase_02 AC 439 ms
272,592 KB
testcase_03 AC 440 ms
272,416 KB
testcase_04 AC 439 ms
272,704 KB
testcase_05 AC 439 ms
273,052 KB
testcase_06 AC 439 ms
272,144 KB
testcase_07 AC 442 ms
271,724 KB
testcase_08 AC 437 ms
272,432 KB
testcase_09 AC 442 ms
271,996 KB
testcase_10 AC 433 ms
271,312 KB
testcase_11 AC 437 ms
272,076 KB
testcase_12 AC 443 ms
273,236 KB
testcase_13 WA -
testcase_14 AC 446 ms
272,084 KB
testcase_15 WA -
testcase_16 AC 446 ms
272,184 KB
testcase_17 WA -
testcase_18 AC 445 ms
272,800 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
d = 21
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