結果

問題 No.1118 sin(x)/xの二乗和
ユーザー hoshiika
提出日時 2020-07-17 23:03:51
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 683 bytes
コンパイル時間 811 ms
コンパイル使用メモリ 103,552 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-11-30 02:26:12
合計ジャッジ時間 1,765 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using static System.Console;
using static System.Math;
using System.Numerics;
using System.Collections.Generic;
using System.Linq;


namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var n = int.Parse(ReadLine());
            //var s = Conasole.ReadLine().Split(' ')
            double[] ans = new double[1001];
            ans[0] = 2.07079632677096370230;
            for (int i = 1; i < 1001; i++)
            {
                double j = Math.Sin(i) / i;
                ans[i] = ans[i - 1] - j * j;
            }


            WriteLine(ans[n]);
            Out.Flush();
        }




    }



}
0