結果

問題 No.1286 Stone Skipping
ユーザー zentsu999zentsu999
提出日時 2020-11-13 22:59:47
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 427 bytes
コンパイル時間 1,039 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 80,268 KB
最終ジャッジ日時 2023-09-30 03:58:19
合計ジャッジ時間 6,993 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,212 KB
testcase_01 AC 70 ms
71,268 KB
testcase_02 AC 74 ms
75,612 KB
testcase_03 AC 69 ms
71,544 KB
testcase_04 AC 68 ms
71,256 KB
testcase_05 AC 70 ms
71,456 KB
testcase_06 AC 70 ms
71,060 KB
testcase_07 AC 69 ms
71,284 KB
testcase_08 AC 70 ms
71,264 KB
testcase_09 AC 71 ms
71,328 KB
testcase_10 AC 75 ms
71,244 KB
testcase_11 AC 72 ms
71,348 KB
testcase_12 AC 70 ms
71,252 KB
testcase_13 AC 73 ms
75,548 KB
testcase_14 AC 73 ms
75,792 KB
testcase_15 AC 73 ms
75,492 KB
testcase_16 AC 74 ms
75,668 KB
testcase_17 AC 75 ms
75,804 KB
testcase_18 AC 71 ms
71,268 KB
testcase_19 AC 71 ms
71,284 KB
testcase_20 AC 74 ms
75,660 KB
testcase_21 AC 74 ms
75,752 KB
testcase_22 AC 75 ms
75,720 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

D=int(input())
L=D//2
R=D
while L!=R:
    now=(L+R)//2
    count=0
    while 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**8):
    count=0
    now=L
    while now>0:
        count+=now
        now//=2
        if count==D:
            ok=1
            break
    if ok:
        break
    L+=1

print(L if ok else D)
0