結果
問題 | No.2352 Sharpened Knife in Fall |
ユーザー |
![]() |
提出日時 | 2023-06-17 03:01:25 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 470 ms / 3,000 ms |
コード長 | 653 bytes |
コンパイル時間 | 1,973 ms |
コンパイル使用メモリ | 194,392 KB |
最終ジャッジ日時 | 2025-02-14 21:54:58 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include<bits/stdc++.h> using namespace std; const double pi=acos(-1); const double EPS=1e-10; double r; bool f(double x,double y){ if((x*sqrt(r*r-x*x)+r*r*atan(x/sqrt(r*r-x*x)))+pi*r*r/2>y-EPS) return true; return false; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int k; cin>>r>>k; double s=pi*r*r/(k+1); for(int i=1;i<=k;i++){ double ok=r,ng=-r; rep(j,100){ double mid=(ok+ng)/2; if(f(mid,(double)s*i)) ok=mid; else ng=mid; } printf("%.20f\n",ok); } return 0; }