結果

問題 No.253 ロウソクの長さ
ユーザー mkawa2mkawa2
提出日時 2020-01-30 22:47:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,160 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 25,132 KB
最終ジャッジ日時 2023-09-23 19:31:52
合計ジャッジ時間 6,877 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 48 ms
24,960 KB
testcase_02 AC 49 ms
24,840 KB
testcase_03 AC 48 ms
24,356 KB
testcase_04 AC 46 ms
24,288 KB
testcase_05 AC 47 ms
24,400 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 47 ms
24,508 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 47 ms
24,484 KB
testcase_15 AC 48 ms
24,976 KB
testcase_16 AC 50 ms
25,020 KB
testcase_17 AC 45 ms
24,844 KB
testcase_18 WA -
testcase_19 AC 46 ms
25,024 KB
testcase_20 WA -
testcase_21 AC 47 ms
24,760 KB
testcase_22 AC 45 ms
24,332 KB
testcase_23 WA -
testcase_24 AC 48 ms
24,324 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 46 ms
25,112 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
from bisect import *
from collections import *
from heapq import *

int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline()[:-1]
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
dij = [(0, 1), (1, 0), (0, -1), (-1, 0)]

def main():
    def ask(m):
        print("?",m)
        ret=int(input())
        if ret==0:
            print("!",m+cnt)
            exit()
        return ret

    cnt=0
    if ask(100)==-1:
        cnt+=1
        while 1:
            ask(0)
            cnt+=1

    l,r=-1,10**9+1
    while l+1<r:
        m=(l+r)//2
        res=ask(m)
        if res==1:l=m
        if res==-1:r=m
        l-=1
        r-=1
        cnt+=1

main()
0