結果

問題 No.146 試験監督(1)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-13 04:23:54
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 549 bytes
コンパイル時間 2,154 ms
コンパイル使用メモリ 71,884 KB
実行使用メモリ 65,872 KB
最終ジャッジ日時 2023-08-17 04:07:01
合計ジャッジ時間 5,999 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
権限があれば一括ダウンロードができます

ソースコード

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!=0){
                a++;
            }
            sum = sum + a*D;
            sum = sum%mod;
        }
        System.out.println(sum);
    }
}
0