結果

問題 No.146 試験監督(1)
ユーザー mitsuomitsuo
提出日時 2016-05-04 23:37:11
言語 Java21
(openjdk 21)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 709 bytes
コンパイル時間 2,538 ms
コンパイル使用メモリ 74,656 KB
実行使用メモリ 56,744 KB
最終ジャッジ日時 2024-04-15 11:44:35
合計ジャッジ時間 8,995 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

public class Main {
	static BigInteger t = BigInteger.ZERO;
	static BigInteger TWO = BigInteger.valueOf(2);
	static BigInteger m = new BigInteger("1000000007");

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		BigInteger N = sc.nextBigInteger();
		while (sc.hasNext()) {
			solve(sc.nextBigInteger(), sc.nextBigInteger());
		}
		t = t.mod(m);
		System.out.println(t.toString());

		sc.close();
	}

	public static void solve(BigInteger s, BigInteger k) {
		if (s.mod(TWO) == BigInteger.ZERO) {
			t = t.add(s.divide(TWO).multiply(k));
		} else {
			t = t.add((s.add(BigInteger.ONE).divide(TWO).multiply(k)));
		}
	}
}
0