結果

問題 No.146 試験監督(1)
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-09-22 02:04:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 520 bytes
コンパイル時間 2,242 ms
コンパイル使用メモリ 72,784 KB
実行使用メモリ 67,924 KB
最終ジャッジ日時 2023-09-25 10:55:22
合計ジャッジ時間 6,136 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long[] c = new long[n];
        long[] d = new long[n];
        for(int i=0; i<n; i++) {
            c[i] = in.nextLong();
            d[i] = in.nextLong();
        }

        long ans = 0;
        for(int i=0; i<n; i++) {
            long t = (c[i] - 1) / 2 + 1;
            ans += t * d[i];
        }

        System.out.println(ans % 1000000007);

    }
}
0