結果

問題 No.1429 Simple Dowsing
ユーザー kotatsugamekotatsugame
提出日時 2021-03-14 14:05:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 64,736 KB
実行使用メモリ 24,348 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 10:00:15
合計ジャッジ時間 1,987 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
24,252 KB
testcase_01 AC 26 ms
23,388 KB
testcase_02 AC 26 ms
24,036 KB
testcase_03 AC 26 ms
24,048 KB
testcase_04 AC 26 ms
23,820 KB
testcase_05 AC 27 ms
24,036 KB
testcase_06 AC 25 ms
24,348 KB
testcase_07 AC 26 ms
23,664 KB
testcase_08 AC 25 ms
23,568 KB
testcase_09 AC 27 ms
24,192 KB
testcase_10 AC 26 ms
24,036 KB
testcase_11 AC 26 ms
23,844 KB
testcase_12 AC 27 ms
23,400 KB
testcase_13 AC 26 ms
23,436 KB
testcase_14 AC 26 ms
23,352 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:3:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    3 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
main()
{
	cout<<"? 0 0"<<endl;
	int x;cin>>x;
	cout<<"? 0 1"<<endl;
	int y;cin>>y;
	for(int a=0;a<=100;a++)for(int b=0;b<=100;b++)
	{
		if(a*a+b*b==x&&a*a+(b-1)*(b-1)==y)
		{
			cout<<"! "<<a<<" "<<b<<endl;
			return 0;
		}
	}
}
0