結果

問題 No.146 試験監督(1)
ユーザー haruki_57
提出日時 2015-02-08 23:29:35
言語 Java
(openjdk 23)
結果
AC  
実行時間 978 ms / 1,000 ms
コード長 535 bytes
コンパイル時間 2,728 ms
コンパイル使用メモリ 74,300 KB
実行使用メモリ 58,124 KB
最終ジャッジ日時 2024-06-23 07:16:35
合計ジャッジ時間 6,316 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;
import java.util.Scanner;


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