結果

問題 No.2831 Cos Bomb Crasher
ユーザー kotatsugamekotatsugame
提出日時 2024-08-02 22:49:49
言語 C++14
(gcc 12.3.0 + boost 1.83.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
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 198 ms
25,184 KB
testcase_01 AC 192 ms
24,812 KB
testcase_02 AC 189 ms
24,812 KB
testcase_03 AC 191 ms
24,940 KB
testcase_04 AC 226 ms
24,812 KB
testcase_05 AC 190 ms
24,940 KB
testcase_06 AC 192 ms
24,940 KB
testcase_07 AC 190 ms
25,196 KB
testcase_08 AC 191 ms
25,196 KB
testcase_09 AC 188 ms
24,556 KB
testcase_10 AC 215 ms
24,940 KB
testcase_11 AC 194 ms
24,812 KB
testcase_12 AC 186 ms
25,196 KB
testcase_13 AC 199 ms
24,940 KB
testcase_14 AC 193 ms
25,196 KB
testcase_15 AC 218 ms
24,940 KB
testcase_16 AC 193 ms
24,940 KB
testcase_17 AC 192 ms
24,812 KB
testcase_18 AC 203 ms
24,812 KB
testcase_19 AC 184 ms
25,196 KB
testcase_20 AC 186 ms
24,940 KB
testcase_21 AC 185 ms
24,928 KB
testcase_22 AC 185 ms
24,556 KB
testcase_23 AC 194 ms
24,940 KB
testcase_24 AC 198 ms
25,452 KB
testcase_25 AC 194 ms
24,812 KB
testcase_26 AC 212 ms
24,940 KB
testcase_27 AC 184 ms
25,196 KB
testcase_28 AC 185 ms
24,940 KB
testcase_29 AC 190 ms
24,940 KB
testcase_30 AC 188 ms
24,812 KB
testcase_31 AC 200 ms
24,940 KB
testcase_32 AC 193 ms
24,556 KB
testcase_33 AC 188 ms
24,812 KB
testcase_34 AC 180 ms
24,812 KB
testcase_35 AC 181 ms
25,196 KB
testcase_36 AC 188 ms
25,452 KB
testcase_37 AC 206 ms
24,812 KB
testcase_38 AC 181 ms
24,812 KB
testcase_39 AC 195 ms
24,940 KB
testcase_40 AC 188 ms
24,556 KB
testcase_41 AC 180 ms
24,556 KB
testcase_42 AC 185 ms
25,196 KB
testcase_43 AC 213 ms
25,196 KB
testcase_44 AC 181 ms
24,940 KB
testcase_45 AC 181 ms
25,040 KB
testcase_46 AC 200 ms
24,940 KB
testcase_47 AC 187 ms
24,812 KB
testcase_48 AC 194 ms
24,940 KB
testcase_49 AC 203 ms
25,196 KB
testcase_50 AC 188 ms
24,796 KB
testcase_51 AC 207 ms
24,928 KB
testcase_52 AC 187 ms
25,196 KB
testcase_53 AC 196 ms
24,812 KB
testcase_54 AC 209 ms
25,452 KB
testcase_55 AC 192 ms
24,940 KB
testcase_56 AC 203 ms
25,196 KB
testcase_57 AC 198 ms
25,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0