結果
問題 | No.2352 Sharpened Knife in Fall |
ユーザー |
|
提出日時 | 2023-06-16 21:46:37 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,358 bytes |
コンパイル時間 | 11,921 ms |
コンパイル使用メモリ | 278,028 KB |
最終ジャッジ日時 | 2025-02-14 05:08:09 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 WA * 16 |
ソースコード
#ifdef LOCAL#include <local.hpp>#else#pragma GCC optimize("O3,unroll-loops")#pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2")#include <bits/stdc++.h>#define debug(...) ((void)0)#define postprocess(...) ((void)0)#endifusing namespace std;using ll = long long;using ld = long double;const ld pi = acosl(-1.0l);inline ld eval(const ld R, const ld theta) {return R * R * (pi * (pi - 2.0l * theta) / (2.0l * pi) - cosl(theta) * sinl(theta));}inline ld search(const ld R, const ld S) {ld imin = 0;ld imax = pi / 2.0l;while (imax - imin > 1e-7) {ld imid = (imin + imax) / 2.0l;(S <= eval(R, imid) ? imin : imax) = imid;}return (imin + imax) / 2.0l;}void solve([[maybe_unused]] int test) {ld R;int K;cin >> R >> K;vector<ld> ans;for (int i = 0; i < K / 2; i++) {ld S = pi * R * R * (ld)(i + 1) / (ld)(K + 1);ld theta = search(R, S);ans.push_back(R * sinl(theta));ans.push_back(-R * sinl(theta));}if (K % 2) ans.push_back(0);sort(ans.begin(), ans.end());for (int i = 0; i < K; i++) {cout << ans[i] << endl;}}int main() {ios::sync_with_stdio(false);cin.tie(nullptr);int t = 1;// cin >> t;for (int i = 1; i <= t; i++) {solve(i);}postprocess();}