結果
問題 |
No.680 作れる数
|
ユーザー |
![]() |
提出日時 | 2025-03-31 17:30:58 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 515 bytes |
コンパイル時間 | 281 ms |
コンパイル使用メモリ | 82,784 KB |
実行使用メモリ | 53,548 KB |
最終ジャッジ日時 | 2025-03-31 17:31:52 |
合計ジャッジ時間 | 1,620 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 WA * 1 |
ソースコード
N = int(input()) def can_create(N): # Check k from 1 to 30 (since 2^31 is about 2e9, which covers N up to 1e9) for k in range(1, 31): remaining = N for j in range(1, k + 1): exponent = k - j + 1 current_val = (1 << exponent) - 1 # equivalent to 2^exponent -1 if remaining >= current_val: remaining -= current_val if remaining == 0: return True return False print("YES" if can_create(N) else "NO")