結果

問題 No.146 試験監督(1)
コンテスト
ユーザー k_kadora
提出日時 2015-06-11 00:03:10
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 516 ms / 1,000 ms
コード長 442 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,248 ms
コンパイル使用メモリ 84,708 KB
実行使用メモリ 61,596 KB
最終ジャッジ日時 2026-03-28 05:17:13
合計ジャッジ時間 5,329 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.Scanner;
public class Test{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n;
		n = Integer.parseInt(sc.next());
		Long res = (long)0,tempc,tempd;
		for(int i = 0;i<n;i++){
			tempc = ((Long.parseLong(sc.next())+1) / 2) % 1000000007;
			tempd = Long.parseLong(sc.next()) % 1000000007;
			res += ( tempc * tempd )% 1000000007;
		}
		res = res % 1000000007;
		System.out.println(res);
	}
}
0