結果
| 問題 | No.2831 Cos Bomb Crasher | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-08-02 22:49:49 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 226 ms / 2,000 ms | 
| コード長 | 1,070 bytes | 
| コンパイル時間 | 1,141 ms | 
| コンパイル使用メモリ | 93,312 KB | 
| 実行使用メモリ | 25,452 KB | 
| 平均クエリ数 | 167.97 | 
| 最終ジャッジ日時 | 2024-08-02 22:50:07 | 
| 合計ジャッジ時間 | 15,824 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 58 | 
ソースコード
#include<iostream>
#include<vector>
#include<cmath>
#include<iomanip>
#include<cassert>
#include<random>
using namespace std;
long double f(long double t)
{
	long double l=0,r=3e8;
	for(int i=0;i<80;i++)
	{
		long double m=(l+r)/2;
		cout<<"1 "<<m*cos(t)<<" "<<m*sin(t)<<endl;
		char P;
		long u,v;
		cin>>P>>u>>v;
		if(P=='+')r=m;
		else l=m;
	}
	return l;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N;cin>>N;
	cout<<fixed<<setprecision(9);
	random_device rng;
	uniform_real_distribution<long double>distr(0,4*M_PI);
	long double t0;
	for(int c=0;c<150;c++)
	{
		t0=distr(rng);
		cout<<"1 "<<0.5*cos(t0)<<" "<<0.5*sin(t0)<<endl;
		char P;
		long u,v;
		cin>>P>>u>>v;
		if(P!='-')continue;
		cout<<"1 "<<0.5*cos(t0+M_PI/2)<<" "<<0.5*sin(t0+M_PI/2)<<endl;
		cin>>P>>u>>v;
		if(P!='-')continue;
		break;
	}
	long double lt=t0,rt=t0+M_PI/2;
	long double ll=f(lt),rl=f(rt);
	long double ax=ll*cos(lt),ay=ll*sin(lt);
	long double bx=rl*cos(rt),by=rl*sin(rt);
	cout<<"2 "<<(ax+bx)/2<<" "<<(ay+by)/2<<" "<<((ax-bx)*(ax-bx)+(ay-by)*(ay-by))/4<<endl;
}
            
            
            
        