結果
| 問題 |
No.680 作れる数
|
| コンテスト | |
| ユーザー |
hang_hang_cln
|
| 提出日時 | 2018-05-07 20:38:34 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 542 bytes |
| コンパイル時間 | 147 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,280 KB |
| 最終ジャッジ日時 | 2024-06-28 02:19:48 |
| 合計ジャッジ時間 | 4,363 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
if (s+t,t) not in NEXTqueue:
NEXTqueue.append((s+t, t))
if (s+t+1, t+1) not in NEXTqueue:
NEXTqueue.append((s+t+1, t+1))
if NEXTqueue[-1][0] > N:
break
if can:
print('YES')
else:
print('NO')
hang_hang_cln