結果

問題 No.146 試験監督(1)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-13 04:27:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 895 ms / 1,000 ms
コード長 591 bytes
コンパイル時間 2,011 ms
コンパイル使用メモリ 71,156 KB
実行使用メモリ 65,764 KB
最終ジャッジ日時 2023-08-17 04:07:13
合計ジャッジ時間 6,232 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 841 ms
65,392 KB
testcase_01 AC 861 ms
65,764 KB
testcase_02 AC 895 ms
64,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long sum = 0L;
        long mod = (long)Math.pow(10,9)+7;
        for(long i=0; i<N; i++){
            long C = sc.nextLong();
            long D = sc.nextLong();
            long a = C/2;
            long b = C%2;
            if(b==1){
                a++;
            }
            a=a%mod;
            D=D%mod;
            sum = sum + a*D;
            sum = sum%mod;
        }
        System.out.println(sum);
    }
}
0