結果

問題 No.1429 Simple Dowsing
ユーザー ryo_nryo_n
提出日時 2021-03-14 14:41:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 557 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 10,880 KB
実行使用メモリ 24,528 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 10:05:01
合計ジャッジ時間 1,949 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
23,812 KB
testcase_01 AC 38 ms
23,904 KB
testcase_02 AC 39 ms
23,480 KB
testcase_03 AC 37 ms
24,360 KB
testcase_04 AC 39 ms
24,360 KB
testcase_05 AC 38 ms
24,048 KB
testcase_06 AC 39 ms
23,688 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 37 ms
23,448 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 38 ms
23,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    print("? 0 0")
    sys.stdout.flush()
    N = int(input())

    a = -1
    b = -1
    for i in range(101):
        for j in range(101):
            if i ** 2 + j ** 2 == N:
                a = i
                b = j
            if a != -1:
                break

    print("?", a, b)
    sys.stdout.flush()
    N = int(input())
    if N == 0:
        print("!", a, b)
    else:
        print("!", b, a)

    sys.stdout.flush()


if __name__ == '__main__':
    main()
0