結果

問題 No.146 試験監督(1)
ユーザー spaciaspacia
提出日時 2016-01-03 18:02:34
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 898 bytes
コンパイル時間 2,406 ms
コンパイル使用メモリ 78,300 KB
実行使用メモリ 61,108 KB
最終ジャッジ日時 2023-10-19 14:46:19
合計ジャッジ時間 4,768 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

class Main {
	
	public static void out (Object o) {
		System.out.println(o);
	}
	
	public static BigDecimal opt (String s) {
		long l = Long.valueOf(s);
		int i = s.charAt(s.length() - 1) - '0';
		if (i % 2 == 0) {
			l = l >>> 1;
		} else {
			l = (l >>> 1) + 1;
		}
		return new BigDecimal(l);
	}
	
	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 m = BigDecimal.valueOf(100000007);
		
		for (int i = 0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			BigDecimal c = opt(line[0]);
			BigDecimal d = new BigDecimal(line[1]);
			ans = ans.add(c.multiply(d));
		}
		
		out(ans.remainder(m));
	}
}
0