結果

問題 No.1429 Simple Dowsing
ユーザー kotatsugamekotatsugame
提出日時 2021-03-14 14:05:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 513 ms
コンパイル使用メモリ 64,532 KB
実行使用メモリ 25,448 KB
平均クエリ数 3.00
最終ジャッジ日時 2024-07-17 10:46:41
合計ジャッジ時間 1,829 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-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