結果
| 問題 | 
                            No.680 作れる数
                             | 
                    
| コンテスト | |
| ユーザー | 
                             hang_hang_cln
                         | 
                    
| 提出日時 | 2018-05-07 20:35:03 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 464 bytes | 
| コンパイル時間 | 99 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 37,376 KB | 
| 最終ジャッジ日時 | 2024-06-28 02:19:38 | 
| 合計ジャッジ時間 | 3,872 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 7 TLE * 1 -- * 12 | 
ソースコード
N = int(input())
# 1
s = 0
t = 0
NEXTqueue = [(0,0)] # 計算待ちキュー
can = False
while True:
    if len(NEXTqueue) == 0:
        break
    s,t = NEXTqueue.pop(0)
    # 2
    t *= 2
    
    # 3
    
    # 4
    #s += t
    if s+t == N or s+t+1 == N:
        can = True
        break
        
    NEXTqueue.append((s+t, t))
    NEXTqueue.append((s+t+1, t+1))
    if NEXTqueue[-1][0] > N:
        break
if can:
    print('YES')
else:
    print('NO')
    
            
            
            
        
            
hang_hang_cln