結果

問題 No.146 試験監督(1)
コンテスト
ユーザー mitsuo
提出日時 2016-05-04 23:28:42
言語 Java
(openjdk 26.0.2.1 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
WA  
実行時間 -
コード長 805 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,465 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 54,704 KB
最終ジャッジ日時 2026-09-10 13:15:34
合計ジャッジ時間 5,130 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package jp.fedom.challange.yuki.q146;

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

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

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

		while (sc.hasNext()) {
			solve(sc.nextLine());
		}
		t = t.mod(m);
		System.out.println(t.toString());

		sc.close();
	}

	public static void solve(String input) {
		if (input.split(" ").length == 1) {
			input = null;
			return;
		}
		String[] ss = input.split(" ");
		long s = Long.valueOf(ss[0]);
		long k = Long.valueOf(ss[1]);
		input = null;

		if (s % 2 == 0) {
			t = t.add(new BigInteger(String.valueOf((s / 2) * k)));
		} else {
			t = t.add(new BigInteger(String.valueOf((s + 1) / 2 * k)));
		}
	}
}
0