結果

問題 No.1272 珍しい級数
ユーザー tentententen
提出日時 2022-08-04 16:56:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 1,094 bytes
コンパイル時間 2,912 ms
コンパイル使用メモリ 72,476 KB
実行使用メモリ 50,808 KB
最終ジャッジ日時 2023-10-12 14:44:41
合計ジャッジ時間 11,581 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
50,004 KB
testcase_01 AC 115 ms
50,360 KB
testcase_02 AC 119 ms
50,808 KB
testcase_03 AC 115 ms
50,392 KB
testcase_04 AC 116 ms
50,196 KB
testcase_05 AC 118 ms
50,276 KB
testcase_06 AC 118 ms
50,200 KB
testcase_07 AC 118 ms
50,700 KB
testcase_08 AC 119 ms
50,276 KB
testcase_09 AC 119 ms
50,348 KB
testcase_10 AC 119 ms
50,348 KB
testcase_11 AC 118 ms
50,424 KB
testcase_12 AC 118 ms
50,332 KB
testcase_13 AC 118 ms
50,028 KB
testcase_14 AC 118 ms
50,032 KB
testcase_15 AC 118 ms
50,028 KB
testcase_16 AC 119 ms
50,200 KB
testcase_17 AC 118 ms
50,032 KB
testcase_18 AC 117 ms
50,448 KB
testcase_19 AC 118 ms
50,312 KB
testcase_20 AC 119 ms
50,116 KB
testcase_21 AC 118 ms
50,256 KB
testcase_22 AC 118 ms
50,356 KB
testcase_23 AC 118 ms
50,220 KB
testcase_24 AC 118 ms
50,272 KB
testcase_25 AC 117 ms
50,748 KB
testcase_26 AC 117 ms
50,200 KB
testcase_27 AC 123 ms
50,704 KB
testcase_28 AC 118 ms
50,452 KB
testcase_29 AC 117 ms
50,324 KB
testcase_30 AC 118 ms
50,240 KB
testcase_31 AC 117 ms
50,452 KB
testcase_32 AC 118 ms
50,340 KB
testcase_33 AC 117 ms
50,460 KB
testcase_34 AC 118 ms
50,288 KB
testcase_35 AC 119 ms
50,240 KB
testcase_36 AC 118 ms
48,812 KB
testcase_37 AC 119 ms
50,028 KB
testcase_38 AC 116 ms
50,108 KB
testcase_39 AC 118 ms
50,212 KB
testcase_40 AC 118 ms
50,272 KB
testcase_41 AC 119 ms
50,256 KB
testcase_42 AC 118 ms
50,384 KB
testcase_43 AC 118 ms
50,420 KB
testcase_44 AC 119 ms
50,384 KB
testcase_45 AC 118 ms
50,360 KB
testcase_46 AC 119 ms
50,324 KB
testcase_47 AC 118 ms
50,276 KB
testcase_48 AC 117 ms
50,452 KB
testcase_49 AC 117 ms
50,208 KB
testcase_50 AC 119 ms
50,788 KB
testcase_51 AC 119 ms
50,200 KB
testcase_52 AC 118 ms
50,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        double n = sc.nextInt();
        double ans = 0;
        for (int i = 1000000; i >= 1; i--) {
            ans += Math.sin(n * i) / Math.pow(i, i);
        }
        System.out.println(new java.math.BigDecimal(ans).toPlainString());
    }
}

class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0