結果

問題 No.146 試験監督(1)
ユーザー tentententen
提出日時 2020-11-05 18:58:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 890 ms / 1,000 ms
コード長 396 bytes
コンパイル時間 2,131 ms
コンパイル使用メモリ 71,504 KB
実行使用メモリ 66,012 KB
最終ジャッジ日時 2023-09-29 17:14:54
合計ジャッジ時間 6,206 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 843 ms
66,012 KB
testcase_01 AC 851 ms
65,452 KB
testcase_02 AC 890 ms
64,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    static final int MOD = 1000000007;
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 0;
		for (int i = 0; i < n; i++) {
		    long c = sc.nextLong();
		    long d = sc.nextLong() % MOD;
		    ans += (c + 1) / 2 % MOD * d % MOD;
		    ans %= MOD;
		}
		System.out.println(ans);
	}
}
0