結果
| 問題 |
No.2352 Sharpened Knife in Fall
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-16 21:33:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 893 ms / 3,000 ms |
| コード長 | 477 bytes |
| コンパイル時間 | 850 ms |
| コンパイル使用メモリ | 74,148 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-24 13:11:25 |
| 合計ジャッジ時間 | 18,232 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int R,K;
long double f(long double theta)
{
return (sin(2*theta)/4+theta/2)*2*R*R;
}
int main()
{
cin>>R>>K;
for(int i=1;i<=K;i++)
{
long double area=M_PI*R*R*(-(long double)0.5+(long double)i/(K+1));
long double l=-M_PI/2,r=M_PI/2;
for(int t=0;t<50;t++)
{
long double theta=(l+r)/2;
if(f(theta)<area)l=theta;
else r=theta;
}
cout<<fixed<<setprecision(16)<<R*sin(r)<<"\n";
}
}