結果

問題 No.1429 Simple Dowsing
ユーザー ks2mks2m
提出日時 2021-03-14 14:42:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 2,819 ms
コンパイル使用メモリ 74,476 KB
実行使用メモリ 72,988 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 10:05:15
合計ジャッジ時間 6,720 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 166 ms
72,728 KB
testcase_01 AC 162 ms
72,468 KB
testcase_02 AC 169 ms
72,476 KB
testcase_03 AC 180 ms
72,772 KB
testcase_04 AC 167 ms
72,648 KB
testcase_05 AC 175 ms
72,544 KB
testcase_06 AC 166 ms
72,596 KB
testcase_07 AC 168 ms
72,988 KB
testcase_08 AC 169 ms
72,844 KB
testcase_09 AC 172 ms
72,920 KB
testcase_10 AC 164 ms
72,920 KB
testcase_11 AC 172 ms
72,540 KB
testcase_12 AC 160 ms
72,748 KB
testcase_13 AC 163 ms
72,472 KB
testcase_14 AC 174 ms
72,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		System.out.println("? 0 0");
		int d1 = sc.nextInt();
		System.out.println("? 0 100");
		int d2 = sc.nextInt();
		sc.close();

		for (int i = 0; i <= 100; i++) {
			for (int j = 0; j <= 100; j++) {
				if (i * i + j * j == d1
						&& i * i + (100 - j) * (100 - j) == d2) {
					System.out.println("! " + i + " " + j);
					return;
				}
			}
		}
	}
}
0