結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-05-04 23:16:27 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 761 bytes |
| コンパイル時間 | 1,910 ms |
| コンパイル使用メモリ | 74,672 KB |
| 実行使用メモリ | 66,368 KB |
| 最終ジャッジ日時 | 2024-10-05 06:53:46 |
| 合計ジャッジ時間 | 6,069 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 3 |
ソースコード
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());
}
System.out.println(t.toString());
sc.close();
}
public static void solve(String input) {
if (input.split(" ").length == 1) {
input = null;
return;
}
long s = Long.valueOf(input.split(" ")[0]);
long k = Long.valueOf(input.split(" ")[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)));
}
t = t.mod(m);
}
}