結果
| 問題 |
No.2352 Sharpened Knife in Fall
|
| コンテスト | |
| ユーザー |
Rubikun
|
| 提出日時 | 2023-06-16 21:30:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,281 bytes |
| コンパイル時間 | 2,109 ms |
| コンパイル使用メモリ | 201,252 KB |
| 最終ジャッジ日時 | 2025-02-14 04:27:47 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 12 WA * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=1<<30;
int main(){
std::ifstream in("text.txt");
std::cin.rdbuf(in.rdbuf());
cin.tie(0);
ios::sync_with_stdio(false);
double R,K;cin>>R>>K;
vector<double> ans;
for(int q=0;q<K/2;q++){
double le=0,ri=R;
for(int qq=0;qq<80;qq++){
double mid=(le+ri)/2;
double X=sqrt(R*R-mid*mid);
double res=R*R*atan2(X,mid);
//cout<<X<<" "<<mid<<" "<<atan2(X,mid)<<endl;
res-=X*mid;
//cout<<res<<" "<<R*R*M_PI<<" "<<R*R*M_PI*(q+1)/(K+1)<<endl;
if(res>=R*R*M_PI*(q+1)/(K+1)) le=mid;
else ri=mid;
}
ans.push_back(le);
}
if((int)(K)&1) ans.push_back(0);
for(int i=0;i<K/2;i++) ans.push_back(-ans[i]);
sort(all(ans));
for(double x:ans) cout<<fixed<<setprecision(25)<<x<<endl;
}
Rubikun