結果
| 問題 |
No.2352 Sharpened Knife in Fall
|
| コンテスト | |
| ユーザー |
FplusFplusF
|
| 提出日時 | 2023-06-16 21:55:36 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,089 bytes |
| コンパイル時間 | 2,070 ms |
| コンパイル使用メモリ | 199,072 KB |
| 最終ジャッジ日時 | 2025-02-14 05:24:14 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 WA * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll,ll>;
using ld=long double;
const ll INF=(1ll<<60);
#define rep(i,n) for (ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(),v.end()
template<class T> void chmin(T &a,T b){
if(a>b){
a=b;
}
}
template<class T> void chmax(T &a,T b){
if(a<b){
a=b;
}
}
ld r,k;
ld f(ld x){
ld w=sqrtl(r*r-x*x)*2;
ld t=w*abs(x)/(ld)2;
ld a=acosl(x/r);
return r*r*a-t;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> r >> k;
ld sum=0;
ld x=r*r*(ld)M_PI/(ld)(k+1);
vector<ld> ans;
rep(i,(ll)k/2){
ld ok=r,ng=-r;
while(0.0000001<abs(ok-ng)){
ld mid=(ok+ng)/2;
if(f(mid)-sum<=x) ok=mid;
else ng=mid;
}
ans.push_back(ok);
sum+=f(ok);
}
if((ll)k%2!=0) ans.push_back(0);
rep(i,(ll)k/2){
ans.push_back(-ans[(ll)k/2-1-i]);
}
reverse(all(ans));
for(auto &i:ans) cout << fixed << setprecision(10) << i << '\n';
}
FplusFplusF