結果
| 問題 | No.146 試験監督(1) |
| コンテスト | |
| ユーザー |
kenkoooo
|
| 提出日時 | 2015-04-06 09:30:02 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 524 ms / 1,000 ms |
| + 963µs | |
| コード長 | 682 bytes |
| 記録 | |
| コンパイル時間 | 1,342 ms |
| コンパイル使用メモリ | 84,220 KB |
| 実行使用メモリ | 56,844 KB |
| 最終ジャッジ日時 | 2026-08-05 22:26:48 |
| 合計ジャッジ時間 | 4,227 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner koko = new Scanner(System.in);
int n = Integer.parseInt(koko.next());
long total = 0;
for (int i = 0; i < n; i++) {
long c = Long.parseLong(koko.next());
long d = Long.parseLong(koko.next());
d = d % 1000000007;
if (c % 2 == 0) {
long e = c / 2;
e = e % 1000000007;
long t = e * d;
t = t % 1000000007;
total = total + t;
} else {
long e = (c + 1) / 2;
e = e % 1000000007;
long t = e * d;
t = t % 1000000007;
total = total + t;
}
total = total % 1000000007;
}
System.out.println(total);
}
}
kenkoooo