結果

問題 No.594 壊れた宝物発見機
ユーザー kotatsugamekotatsugame
提出日時 2019-10-12 18:14:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 578 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 66,288 KB
実行使用メモリ 43,224 KB
最終ジャッジ日時 2023-09-23 18:16:48
合計ジャッジ時間 7,001 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:10:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
   10 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
int f(int x,int y,int z)
{
	cout<<"? "<<x<<" "<<y<<" "<<z<<endl;
	int ans;cin>>ans;
	return ans;
}
main()
{
	int L=-101,R=101;
	while(R-L>1)
	{
		int M1=(L+L+R)/3,M2=(L+R+R)/3;
		if(f(M1,0,0)>f(M2,0,0))L=M1;
		else R=M2;
	}
	int X=L;
	L=-101,R=101;
	while(R-L>1)
	{
		int M1=(L+L+R)/3,M2=(L+R+R)/3;
		if(f(X,M1,0)>f(X,M2,0))L=M1;
		else R=M2;
	}
	int Y=L;
	L=-101,R=101;
	while(R-L>1)
	{
		int M1=(L+L+R)/3,M2=(L+R+R)/3;
		if(f(X,Y,M1)>f(X,Y,M2))L=M1;
		else R=M2;
	}
	int Z=L;
	cout<<"! "<<X<<" "<<Y<<" "<<Z<<endl;
}
0