結果

問題 No.146 試験監督(1)
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-29 18:58:03
言語 Java19
(openjdk 21)
結果
WA  
実行時間 -
コード長 750 bytes
コンパイル時間 2,114 ms
コンパイル使用メモリ 72,556 KB
実行使用メモリ 68,052 KB
最終ジャッジ日時 2023-10-11 20:24:13
合計ジャッジ時間 6,604 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        long accomodates = 0;
        int mod = 1000000007;
        for (long i = 0; i < N; i++) {
            long c = Long.parseLong(sc.next());
            long d = Long.parseLong(sc.next());
            c = (c+1)/2;
            c = c % mod;
            d = d % mod;

            accomodates+= (c*d)%mod;
        }
        System.out.println(accomodates);
    }
}
0