結果

問題 No.1286 Stone Skipping
ユーザー zentsu999zentsu999
提出日時 2020-11-13 22:42:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 626 bytes
コンパイル時間 1,045 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 76,068 KB
最終ジャッジ日時 2023-09-30 03:42:41
合計ジャッジ時間 4,859 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,308 KB
testcase_01 AC 63 ms
71,252 KB
testcase_02 AC 67 ms
75,496 KB
testcase_03 AC 66 ms
71,240 KB
testcase_04 AC 64 ms
71,308 KB
testcase_05 AC 66 ms
71,328 KB
testcase_06 AC 65 ms
71,176 KB
testcase_07 AC 64 ms
71,144 KB
testcase_08 AC 64 ms
71,408 KB
testcase_09 AC 62 ms
71,192 KB
testcase_10 AC 62 ms
71,248 KB
testcase_11 AC 60 ms
71,196 KB
testcase_12 AC 63 ms
71,248 KB
testcase_13 AC 68 ms
75,680 KB
testcase_14 AC 64 ms
75,596 KB
testcase_15 AC 64 ms
75,476 KB
testcase_16 AC 68 ms
75,640 KB
testcase_17 AC 65 ms
75,644 KB
testcase_18 AC 64 ms
71,232 KB
testcase_19 AC 62 ms
71,200 KB
testcase_20 AC 66 ms
75,796 KB
testcase_21 AC 65 ms
75,500 KB
testcase_22 AC 65 ms
75,896 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 65 ms
75,656 KB
testcase_26 AC 67 ms
75,644 KB
testcase_27 AC 63 ms
75,528 KB
testcase_28 AC 63 ms
75,556 KB
権限があれば一括ダウンロードができます

ソースコード

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(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**7):
        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)
0