結果
| 問題 |
No.2352 Sharpened Knife in Fall
|
| コンテスト | |
| ユーザー |
planes
|
| 提出日時 | 2023-06-17 16:34:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 974 bytes |
| コンパイル時間 | 1,851 ms |
| コンパイル使用メモリ | 173,124 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-25 06:52:35 |
| 合計ジャッジ時間 | 10,820 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
ll INF=2e18;
double R;
double pi=3.14159265358979;
double solve(double a) {
double m=R*cos(a)*R*sin(a);
m+=R*R*a;
return pi*R*R/2-m;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin>>R;
ll K;cin>>K;
double S=pi*R*R;
S/=(double)(K+1);
vector<double> ans(0);
if(K%2!=0) ans.push_back(0.0);
K/=2;
double last=pi/2.0*10000000000000.0;
for(ll i=0;i<K;i++) {
double a=(double)last/10000000000000.0;
ll s=0; ll g=last;
while(s<g) {
ll k=(s+g)/2;
double x=(double)k/10000000000000.0;
if(solve(x)-solve(a)<=S) {
g=k;
}
else s=k+1;
}
last=s;
ans.push_back(last/10000000000000.0);
ans.push_back(-1*last/10000000000000.0);
}
sort(all(ans));
cout<<fixed<<setprecision(10);
for(auto x:ans) cout<<R*sin(x)<<endl;
}
planes