結果

問題 No.1272 珍しい級数
ユーザー tentententen
提出日時 2022-10-04 11:13:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 736 ms / 2,000 ms
コード長 1,105 bytes
コンパイル時間 1,861 ms
コンパイル使用メモリ 71,484 KB
実行使用メモリ 50,144 KB
最終ジャッジ日時 2023-08-28 15:01:55
合計ジャッジ時間 43,031 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 271 ms
49,952 KB
testcase_01 AC 722 ms
49,760 KB
testcase_02 AC 727 ms
49,760 KB
testcase_03 AC 728 ms
49,856 KB
testcase_04 AC 728 ms
49,800 KB
testcase_05 AC 729 ms
50,056 KB
testcase_06 AC 734 ms
49,540 KB
testcase_07 AC 728 ms
49,756 KB
testcase_08 AC 729 ms
49,760 KB
testcase_09 AC 725 ms
49,872 KB
testcase_10 AC 732 ms
49,832 KB
testcase_11 AC 727 ms
49,800 KB
testcase_12 AC 735 ms
49,752 KB
testcase_13 AC 728 ms
49,884 KB
testcase_14 AC 736 ms
49,904 KB
testcase_15 AC 728 ms
49,764 KB
testcase_16 AC 731 ms
49,756 KB
testcase_17 AC 732 ms
49,552 KB
testcase_18 AC 723 ms
49,636 KB
testcase_19 AC 734 ms
49,748 KB
testcase_20 AC 734 ms
49,852 KB
testcase_21 AC 730 ms
49,764 KB
testcase_22 AC 729 ms
49,952 KB
testcase_23 AC 731 ms
49,912 KB
testcase_24 AC 725 ms
49,516 KB
testcase_25 AC 729 ms
49,820 KB
testcase_26 AC 727 ms
49,952 KB
testcase_27 AC 723 ms
49,852 KB
testcase_28 AC 732 ms
50,080 KB
testcase_29 AC 729 ms
49,680 KB
testcase_30 AC 730 ms
49,892 KB
testcase_31 AC 729 ms
49,872 KB
testcase_32 AC 731 ms
49,756 KB
testcase_33 AC 724 ms
49,752 KB
testcase_34 AC 730 ms
49,780 KB
testcase_35 AC 736 ms
49,764 KB
testcase_36 AC 730 ms
49,636 KB
testcase_37 AC 729 ms
49,552 KB
testcase_38 AC 733 ms
50,144 KB
testcase_39 AC 724 ms
49,868 KB
testcase_40 AC 728 ms
49,864 KB
testcase_41 AC 733 ms
50,052 KB
testcase_42 AC 732 ms
50,056 KB
testcase_43 AC 735 ms
47,980 KB
testcase_44 AC 730 ms
49,752 KB
testcase_45 AC 726 ms
49,840 KB
testcase_46 AC 733 ms
49,932 KB
testcase_47 AC 729 ms
49,624 KB
testcase_48 AC 725 ms
49,756 KB
testcase_49 AC 728 ms
49,800 KB
testcase_50 AC 728 ms
49,836 KB
testcase_51 AC 731 ms
49,852 KB
testcase_52 AC 732 ms
49,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        double k = sc.nextInt();
        double ans = 0;
        for (int i = 1; i < 10000000; i++) {
            ans += Math.sin(k * i) / Math.pow(i, i);
        }
        System.out.println(ans);
    }
}
    
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    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