結果
| 問題 | No.680 作れる数 | 
| コンテスト | |
| ユーザー |  lam6er | 
| 提出日時 | 2025-03-26 15:46:34 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 41 ms / 2,000 ms | 
| コード長 | 375 bytes | 
| コンパイル時間 | 203 ms | 
| コンパイル使用メモリ | 82,784 KB | 
| 実行使用メモリ | 52,096 KB | 
| 最終ジャッジ日時 | 2025-03-26 15:47:16 | 
| 合計ジャッジ時間 | 1,907 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 20 | 
ソースコード
n = int(input())
if n == 0:
    print("YES")
else:
    terms = []
    m = 1
    while True:
        term = (1 << m) - 1
        if term > n:
            break
        terms.append(term)
        m += 1
    terms.sort(reverse=True)
    remaining = n
    for term in terms:
        if term <= remaining:
            remaining -= term
    print("YES" if remaining == 0 else "NO")
            
            
            
        