結果

問題 No.146 試験監督(1)
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-13 17:44:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 836 ms / 1,000 ms
コード長 372 bytes
コンパイル時間 2,108 ms
コンパイル使用メモリ 70,900 KB
実行使用メモリ 65,732 KB
最終ジャッジ日時 2023-08-19 23:57:34
合計ジャッジ時間 6,020 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 827 ms
64,756 KB
testcase_01 AC 825 ms
65,732 KB
testcase_02 AC 836 ms
64,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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