結果

問題 No.146 試験監督(1)
ユーザー k_kadorak_kadora
提出日時 2015-06-10 23:41:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 897 ms / 1,000 ms
コード長 475 bytes
コンパイル時間 3,334 ms
コンパイル使用メモリ 72,460 KB
実行使用メモリ 66,944 KB
最終ジャッジ日時 2023-09-20 20:40:52
合計ジャッジ時間 7,542 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 897 ms
65,180 KB
testcase_01 AC 867 ms
66,944 KB
testcase_02 AC 883 ms
65,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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