結果

問題 No.1272 珍しい級数
ユーザー kotatsugame
提出日時 2020-11-07 21:04:00
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 703 ms
コンパイル使用メモリ 73,660 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-22 14:48:59
合計ジャッジ時間 1,968 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int K;
main()
{
	cin>>K;
	double ans=0;
	for(int n=1;n<20;n++)
	{
		double now=sin(K*n);
		for(int i=0;i<n;i++)now/=n;
		ans+=now;
	}
	cout<<fixed<<setprecision(16)<<ans<<endl;
}
0