結果

問題 No.1429 Simple Dowsing
コンテスト
ユーザー kotatsugame
提出日時 2021-03-14 14:05:39
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 269 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 344 ms
コンパイル使用メモリ 73,840 KB
実行使用メモリ 28,732 KB
平均クエリ数 3.00
最終ジャッジ日時 2026-04-01 01:27:40
合計ジャッジ時間 1,531 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main()
      | ^~~~

ソースコード

diff #
raw source code

#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