結果

問題 No.2352 Sharpened Knife in Fall
ユーザー kotatsugamekotatsugame
提出日時 2023-06-16 21:33:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 846 ms / 3,000 ms
コード長 477 bytes
コンパイル時間 815 ms
コンパイル使用メモリ 72,564 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-06 18:49:31
合計ジャッジ時間 18,470 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 759 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 833 ms
4,380 KB
testcase_07 AC 424 ms
4,380 KB
testcase_08 AC 845 ms
4,380 KB
testcase_09 AC 846 ms
4,376 KB
testcase_10 AC 844 ms
4,380 KB
testcase_11 AC 841 ms
4,384 KB
testcase_12 AC 842 ms
4,384 KB
testcase_13 AC 840 ms
4,384 KB
testcase_14 AC 395 ms
4,380 KB
testcase_15 AC 790 ms
4,380 KB
testcase_16 AC 42 ms
4,380 KB
testcase_17 AC 20 ms
4,380 KB
testcase_18 AC 303 ms
4,380 KB
testcase_19 AC 662 ms
4,384 KB
testcase_20 AC 259 ms
4,384 KB
testcase_21 AC 247 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int R,K;
long double f(long double theta)
{
	return (sin(2*theta)/4+theta/2)*2*R*R;
}
int main()
{
	cin>>R>>K;
	for(int i=1;i<=K;i++)
	{
		long double area=M_PI*R*R*(-(long double)0.5+(long double)i/(K+1));
		long double l=-M_PI/2,r=M_PI/2;
		for(int t=0;t<50;t++)
		{
			long double theta=(l+r)/2;
			if(f(theta)<area)l=theta;
			else r=theta;
		}
		cout<<fixed<<setprecision(16)<<R*sin(r)<<"\n";
	}
}
0