結果

問題 No.146 試験監督(1)
ユーザー Pump0129Pump0129
提出日時 2018-03-27 23:34:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 675 ms / 1,000 ms
コード長 641 bytes
コンパイル時間 1,898 ms
コンパイル使用メモリ 71,896 KB
実行使用メモリ 68,168 KB
最終ジャッジ日時 2023-09-07 19:12:00
合計ジャッジ時間 5,238 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 638 ms
67,772 KB
testcase_01 AC 639 ms
68,168 KB
testcase_02 AC 675 ms
67,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package net.ipipip0129.yukicoder.no146;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int cnt = Integer.parseInt(scan.nextLine());

        long capacity = 0;

        for (int i = 0; i < cnt; i++) {
            String[] data = scan.nextLine().split(" ");

            long c = (Long.parseLong(data[0]) + 1) / 2 % 1000000007L;
            long d = Long.parseLong(data[1]) % 1000000007L;

            capacity += c * d;
            capacity %= 1000000007L;
        }

        System.out.println(capacity);
    }
}
0