結果

問題 No.1429 Simple Dowsing
ユーザー 👑 ygussanyygussany
提出日時 2021-03-14 14:28:14
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 811 ms
コンパイル使用メモリ 27,712 KB
実行使用メモリ 24,336 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 10:03:51
合計ジャッジ時間 2,300 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
23,364 KB
testcase_01 AC 21 ms
23,868 KB
testcase_02 AC 22 ms
24,192 KB
testcase_03 AC 21 ms
23,364 KB
testcase_04 AC 21 ms
23,484 KB
testcase_05 AC 22 ms
24,336 KB
testcase_06 AC 23 ms
23,352 KB
testcase_07 AC 21 ms
23,340 KB
testcase_08 AC 22 ms
23,496 KB
testcase_09 AC 21 ms
23,652 KB
testcase_10 AC 21 ms
23,640 KB
testcase_11 AC 21 ms
24,012 KB
testcase_12 AC 23 ms
24,024 KB
testcase_13 AC 22 ms
23,892 KB
testcase_14 AC 22 ms
23,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main()
{
	int a, b, x, y;
	printf("? 0 0\n");
	fflush(stdout);
	scanf("%d", &a);
	printf("? 0 100\n");
	fflush(stdout);
	scanf("%d", &b);
	for (x = 0; x <= 100; x++) {
		for (y = 0; y <= 100; y++) {
			if (x * x + y * y == a && x * x + (100 - y) * (100 - y) == b) break;
		}
		if (y <= 100) break;
	}
	printf("! %d %d\n", x, y);
	fflush(stdout);
	return 0;
}
0