結果
| 問題 | 
                            No.1286 Stone Skipping
                             | 
                    
| コンテスト | |
| ユーザー | 
                             zentsu999
                         | 
                    
| 提出日時 | 2020-11-13 22:44:08 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 626 bytes | 
| コンパイル時間 | 310 ms | 
| コンパイル使用メモリ | 82,528 KB | 
| 実行使用メモリ | 59,904 KB | 
| 最終ジャッジ日時 | 2024-07-22 21:44:45 | 
| 合計ジャッジ時間 | 5,602 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 24 WA * 1 TLE * 1 | 
ソースコード
D=int(input())
L=D//2
R=D
while L!=R:
    now=(L+R)//2
    count=0
    while count<D and now>0:
        count+=now
        now//=2
    if count>=D:
        R=(L+R)//2
    else:
        L=(L+R)//2+1
ok=0
for _ in range(10**7):
    count=0
    now=L
    while count<D:
        count+=now
        now//=2
    if count==D:
        ok=1
        break
    L+=1
if ok==0:
    L+=D//3
    for _ in range(10**8):
        count=0
        now=L
        while count<D:
            count+=now
            now//=2
        if count==D:
            ok=1
            break
        L+=1
print(L if ok else D)
            
            
            
        
            
zentsu999