結果

問題 No.1286 Stone Skipping
ユーザー zentsu999zentsu999
提出日時 2020-11-13 22:48:44
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 414 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 80,100 KB
最終ジャッジ日時 2023-09-30 03:49:05
合計ジャッジ時間 7,600 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
75,688 KB
testcase_01 AC 77 ms
71,464 KB
testcase_02 AC 80 ms
75,704 KB
testcase_03 AC 79 ms
71,324 KB
testcase_04 AC 75 ms
71,468 KB
testcase_05 AC 78 ms
71,176 KB
testcase_06 AC 77 ms
71,436 KB
testcase_07 AC 76 ms
71,260 KB
testcase_08 AC 78 ms
71,408 KB
testcase_09 AC 76 ms
71,548 KB
testcase_10 AC 77 ms
71,264 KB
testcase_11 AC 77 ms
71,264 KB
testcase_12 AC 77 ms
71,456 KB
testcase_13 AC 79 ms
75,696 KB
testcase_14 AC 79 ms
75,732 KB
testcase_15 AC 81 ms
75,664 KB
testcase_16 AC 78 ms
75,724 KB
testcase_17 AC 80 ms
75,596 KB
testcase_18 AC 76 ms
71,252 KB
testcase_19 AC 76 ms
71,472 KB
testcase_20 AC 80 ms
75,608 KB
testcase_21 AC 80 ms
75,860 KB
testcase_22 AC 81 ms
75,968 KB
testcase_23 AC 1,320 ms
75,872 KB
testcase_24 TLE -
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 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(5*10**7):
    count=0
    now=L
    while count<D and now>0:
        count+=now
        now//=2
    if count==D:
        ok=1
        break
    L+=1

print(L if ok else D)
0