結果

問題 No.1286 Stone Skipping
ユーザー tktk_snsntktk_snsn
提出日時 2020-11-30 00:13:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 554 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 76,060 KB
最終ジャッジ日時 2023-10-11 02:41:23
合計ジャッジ時間 4,190 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,448 KB
testcase_01 AC 71 ms
71,448 KB
testcase_02 AC 73 ms
75,716 KB
testcase_03 AC 70 ms
71,168 KB
testcase_04 AC 71 ms
71,320 KB
testcase_05 AC 71 ms
71,416 KB
testcase_06 AC 71 ms
71,640 KB
testcase_07 AC 71 ms
71,172 KB
testcase_08 AC 71 ms
71,568 KB
testcase_09 AC 71 ms
71,496 KB
testcase_10 AC 71 ms
71,420 KB
testcase_11 AC 71 ms
71,428 KB
testcase_12 AC 72 ms
71,572 KB
testcase_13 AC 74 ms
75,900 KB
testcase_14 AC 75 ms
75,784 KB
testcase_15 AC 74 ms
75,800 KB
testcase_16 AC 75 ms
75,716 KB
testcase_17 AC 74 ms
75,800 KB
testcase_18 AC 71 ms
71,648 KB
testcase_19 AC 72 ms
71,560 KB
testcase_20 AC 73 ms
75,676 KB
testcase_21 AC 74 ms
75,800 KB
testcase_22 AC 75 ms
75,948 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 74 ms
75,728 KB
testcase_26 AC 72 ms
75,636 KB
testcase_27 AC 72 ms
75,856 KB
testcase_28 AC 76 ms
76,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())

l = 0
r = D
while r - l > 1:
    m = (r + l) // 2
    cnt = 0
    x = m
    while x:
        cnt += x
        x //= 2
    if cnt < D:
        l = m
    else:
        r = m

for i in range(10**6):
    x = r + i
    tmp = x
    dist = 0
    while True:
        dist += x
        if dist >= D:
            break
        x //= 2
    if D == dist:
        break

print(tmp)
0