結果
| 問題 | 
                            No.1286 Stone Skipping
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-01-19 12:40:20 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 330 bytes | 
| コンパイル時間 | 282 ms | 
| コンパイル使用メモリ | 82,176 KB | 
| 実行使用メモリ | 65,920 KB | 
| 最終ジャッジ日時 | 2024-11-23 13:47:48 | 
| 合計ジャッジ時間 | 2,835 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 WA * 1 | 
ソースコード
d=int(input())
def distance(x):
    res=0
    while x>0:
        res+=x
        x//=2
        if res>=d:
            break
    return res
for i in range(100,0,-1):
    t=d*(2**(i-1))//(2**i-1)
    for j in range(-10,10):
        if t+j<0:
            continue
        if distance(t+j)==d:
            print(t+j)
            exit()