結果

問題 No.146 試験監督(1)
ユーザー dazydazy
提出日時 2016-09-21 15:53:10
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 699 bytes
コンパイル時間 4,038 ms
コンパイル使用メモリ 75,312 KB
実行使用メモリ 55,684 KB
最終ジャッジ日時 2024-04-28 16:45:14
合計ジャッジ時間 9,485 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.*;

public class Run {
    final static int M = 1000000007;
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        String C, D;
        int c ,d;
        long ans = 0;
        for (int i = 0; i < N; i++) {
            c = d = 0;
            C = scan.next();
            D = scan.next();
            for (int j = 0; j < C.length(); j++) c = (c*10 + Integer.valueOf(C.substring(j, j+1))) % M;
            for (int j = 0; j < D.length(); j++) d = (d*10 + Integer.valueOf(D.substring(j, j+1))) % M;
            c = (c + 1)/2;
            ans += (c * d) % M;
        }
        System.out.println(ans);
    }
}
0