結果

問題 No.881 sin(x)/xの和
ユーザー 37zigen37zigen
提出日時 2019-09-01 13:11:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 324 ms / 2,000 ms
コード長 659 bytes
コンパイル時間 2,517 ms
コンパイル使用メモリ 75,748 KB
実行使用メモリ 61,064 KB
最終ジャッジ日時 2024-05-01 06:16:33
合計ジャッジ時間 8,723 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 306 ms
60,596 KB
testcase_01 AC 272 ms
59,316 KB
testcase_02 AC 245 ms
59,392 KB
testcase_03 AC 239 ms
58,980 KB
testcase_04 AC 324 ms
60,888 KB
testcase_05 AC 216 ms
58,220 KB
testcase_06 AC 185 ms
54,448 KB
testcase_07 AC 217 ms
58,408 KB
testcase_08 AC 292 ms
60,584 KB
testcase_09 AC 265 ms
59,576 KB
testcase_10 AC 269 ms
60,144 KB
testcase_11 AC 277 ms
59,836 KB
testcase_12 AC 297 ms
61,064 KB
testcase_13 AC 257 ms
60,752 KB
testcase_14 AC 226 ms
58,448 KB
testcase_15 AC 249 ms
58,540 KB
testcase_16 AC 294 ms
59,896 KB
testcase_17 AC 227 ms
58,884 KB
testcase_18 AC 236 ms
59,644 KB
testcase_19 AC 277 ms
59,532 KB
testcase_20 AC 182 ms
55,112 KB
testcase_21 AC 266 ms
60,284 KB
testcase_22 AC 270 ms
59,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if (!(1 <= n && n <= 1000))
			throw new AssertionError();
		double sum = 0;
		for (int i = 0; i < n; ++i) {
			double x = sc.nextDouble();
			double a = sc.nextDouble();
			if (!(Math.abs(a) <= 1 && 0 <= x && x <= 2 * Math.PI))
				throw new AssertionError();
			sum += a;
		}
		System.out.println(sum * Math.PI);
	}

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}
0