結果

問題 No.146 試験監督(1)
ユーザー TatsuDXTatsuDX
提出日時 2016-09-09 00:00:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 861 ms / 1,000 ms
コード長 348 bytes
コンパイル時間 3,399 ms
コンパイル使用メモリ 74,152 KB
実行使用メモリ 68,876 KB
最終ジャッジ日時 2024-04-27 18:10:08
合計ジャッジ時間 6,629 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 850 ms
68,876 KB
testcase_01 AC 861 ms
68,476 KB
testcase_02 AC 752 ms
68,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

		int num = sc.nextInt();
		long sum = 0, e = 1000000007, n, m;
		for(int i = 0; i < num; i++){
			n = ((sc.nextLong()+1)/2) % e;
			m = sc.nextLong() % e;
			sum += n*m;
			sum %= e;
		}
		System.out.println(sum);
	}
}
0