結果

問題 No.2352 Sharpened Knife in Fall
ユーザー Carpenters-Cat
提出日時 2023-06-16 21:42:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 641 ms / 3,000 ms
コード長 461 bytes
コンパイル時間 1,894 ms
コンパイル使用メモリ 194,256 KB
最終ジャッジ日時 2025-02-14 04:55:15
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

double calc(double th) {
	return th - cos(th) * sin(th);
}

double const PI = 3.141592653589793238;
int main () {
	double R;
	int K;
	cin >> R >> K;
	for (int i = K; i > 0; i --) {
		double ok = 0, ng = PI;
		for (int j = 0; j < 100; j ++) {
			double mu = (ok + ng) / 2;
			if (calc(mu) < PI / (K + 1.0) * i) {
				ok = mu;
			} else {
				ng = mu;
			}
		}
		cout << setprecision(20) << R * cos(ok) << endl;
	}
}
0