結果
| 問題 |
No.2831 Cos Bomb Crasher
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-02 22:27:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,144 bytes |
| コンパイル時間 | 969 ms |
| コンパイル使用メモリ | 94,196 KB |
| 実行使用メモリ | 25,836 KB |
| 平均クエリ数 | 362.66 |
| 最終ジャッジ日時 | 2024-08-02 22:28:07 |
| 合計ジャッジ時間 | 18,787 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 58 |
ソースコード
#include<iostream>
#include<vector>
#include<cmath>
#include<iomanip>
#include<cassert>
#include<random>
using namespace std;
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,1);
long double t0=distr(rng);
while(true)
{
cout<<"1 "<<0.5*cos(t0)<<" "<<0.5*sin(t0)<<endl;
char P;
long u,v;
cin>>P>>u>>v;
if(P=='-')break;
t0+=M_PI/2;
}
long double lt=t0-M_PI/2,rt=t0+M_PI/2;
for(int i=0;i<120;i++)
{
long double t1=(lt+lt+rt)/3,t2=(lt+rt+rt)/3;
cout<<"1 "<<0.5*cos(t1)<<" "<<0.5*sin(t1)<<endl;
char P1;
long u1,v1;
cin>>P1>>u1>>v1;
if(P1=='-')u1=-u1;
cout<<"1 "<<0.5*cos(t2)<<" "<<0.5*sin(t2)<<endl;
char P2;
long u2,v2;
cin>>P2>>u2>>v2;
if(P2=='-')u2=-u2;
if((__int128)u1*v2<(__int128)u2*v1)rt=t2;
else lt=t1;
}
long double l=0,r=3e8;
for(int i=0;i<120;i++)
{
long double m=(l+r)/2;
cout<<"1 "<<m*cos(lt)<<" "<<m*sin(lt)<<endl;
char P;
long u,v;
cin>>P>>u>>v;
if(P=='+')r=m;
else l=m;
}
cout<<"2 "<<l/2*cos(lt)<<" "<<l/2*sin(lt)<<" "<<(l/2)*(l/2)<<endl;
}