結果

問題 No.1429 Simple Dowsing
ユーザー kokatsukokatsu
提出日時 2022-04-07 19:59:49
言語 D
(dmd 2.106.1)
結果
TLE  
実行時間 -
コード長 336 bytes
コンパイル時間 3,030 ms
コンパイル使用メモリ 206,388 KB
実行使用メモリ 36,404 KB
最終ジャッジ日時 2023-09-04 16:39:31
合計ジャッジ時間 9,950 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int L = 100;
    int[] p = [0, L], q = [0, 0];

    auto d = new int[](2);
    foreach (i; 0 .. 2) {
        writefln("? %d %d", p[i], q[i]);
        readf("%d\n", d[i]);
    }

    int r = (L * L + d[0] - d[1]) / (L * 2);
    int s = to!real(d[0]-r*r).sqrt.floor.to!int;

    writefln("! %d %d", r, s);
}
0