結果

問題 No.146 試験監督(1)
ユーザー spaciaspacia
提出日時 2016-01-03 17:22:56
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 930 bytes
コンパイル時間 2,463 ms
コンパイル使用メモリ 78,528 KB
実行使用メモリ 79,504 KB
最終ジャッジ日時 2023-10-19 14:43:22
合計ジャッジ時間 7,146 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Main {
	
	public static void out (Object o) {
		System.out.println(o);
	}
		
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		BigDecimal ans = BigDecimal.ZERO;
		BigDecimal two = BigDecimal.valueOf(2);
		BigDecimal m2 = BigDecimal.valueOf(10000000000L);
		BigDecimal m = BigDecimal.valueOf(1000000007);
		
		for (int i = 0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			int len = line[1].length();
			line[1] = len > 10 ? line[1].substring(len - 10 , len) : line[1];
			BigDecimal c = new BigDecimal(line[0]).divide(two).setScale(0 , RoundingMode.CEILING).remainder(m2);
			BigDecimal d = new BigDecimal(line[1]);
			//out(c + " , " + d);
			ans = ans.add(c.multiply(d)).remainder(m);
		}
		
		out(ans);
	}
}
0