結果

問題 No.513 宝探し2
ユーザー kohei2019kohei2019
提出日時 2022-05-15 13:47:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 515 ms
コンパイル使用メモリ 86,860 KB
実行使用メモリ 87,448 KB
平均クエリ数 58.58
最終ジャッジ日時 2023-10-09 22:06:22
合計ジャッジ時間 4,008 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 100 ms
87,400 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 102 ms
87,168 KB
testcase_09 AC 102 ms
87,368 KB
testcase_10 WA -
testcase_11 AC 105 ms
87,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def func(arg):
    print(arg,0)
    a = int(input())
    if a == 0:
        exit()
    return a

def sanbunntan(l,r):
    while l + 2 < r:
        c1 = l+(r-l)//3
        c2 = r-(r-l)//3
        if func(c1)<func(c2):
            r = c2
        else:
            l = c1
    val = sorted([(func(i),i) for i in range(l,r+1)])[0][1]
    return val

x = sanbunntan(0, 100001)
y = func(x)-x

print(x,y)
int(input())
0