結果

問題 No.881 sin(x)/xの和
ユーザー 37zigen37zigen
提出日時 2019-09-01 13:11:48
言語 Java19
(openjdk 21)
結果
AC  
実行時間 363 ms / 2,000 ms
コード長 659 bytes
コンパイル時間 1,984 ms
コンパイル使用メモリ 73,828 KB
実行使用メモリ 62,792 KB
最終ジャッジ日時 2023-08-13 13:01:29
合計ジャッジ時間 10,188 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 348 ms
61,924 KB
testcase_01 AC 310 ms
61,916 KB
testcase_02 AC 287 ms
60,988 KB
testcase_03 AC 290 ms
61,468 KB
testcase_04 AC 363 ms
62,000 KB
testcase_05 AC 238 ms
60,044 KB
testcase_06 AC 224 ms
57,024 KB
testcase_07 AC 260 ms
61,740 KB
testcase_08 AC 343 ms
61,444 KB
testcase_09 AC 310 ms
61,012 KB
testcase_10 AC 299 ms
61,000 KB
testcase_11 AC 331 ms
61,424 KB
testcase_12 AC 342 ms
62,356 KB
testcase_13 AC 299 ms
61,724 KB
testcase_14 AC 272 ms
60,592 KB
testcase_15 AC 271 ms
60,712 KB
testcase_16 AC 311 ms
62,792 KB
testcase_17 AC 267 ms
61,068 KB
testcase_18 AC 289 ms
60,968 KB
testcase_19 AC 317 ms
61,360 KB
testcase_20 AC 210 ms
56,328 KB
testcase_21 AC 310 ms
61,376 KB
testcase_22 AC 311 ms
61,280 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