結果
問題 | No.2352 Sharpened Knife in Fall |
ユーザー |
![]() |
提出日時 | 2024-04-16 12:18:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 445 ms / 3,000 ms |
コード長 | 867 bytes |
コンパイル時間 | 2,131 ms |
コンパイル使用メモリ | 199,384 KB |
最終ジャッジ日時 | 2025-02-21 02:29:23 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
#include <bits/stdc++.h>using namespace std;void fast_io() {ios_base::sync_with_stdio(false);cin.tie(nullptr);}#define PI 3.14159265358979323846int main() {fast_io();int R, k;cin >> R >> k;vector<double> ans;for (int i = 1; i <= k / 2; i++) {auto f = [&](double theta) { return theta - sin(2 * theta) / 2; };double l = 0, r = PI / 2;for (int j = 0; j < 100; j++) {double m = (l + r) / 2;if (f(m) < PI * i / (k + 1)) {l = m;} else {r = m;}}ans.push_back(R * cos(l));ans.push_back(-R * cos(l));}if (k % 2 == 1) {ans.push_back(0);}sort(ans.begin(), ans.end());cout << setprecision(16) << fixed;for (auto e : ans) {cout << e << endl;}}