結果

問題 No.146 試験監督(1)
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-06 09:42:51
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 923 bytes
コンパイル時間 1,964 ms
コンパイル使用メモリ 74,240 KB
実行使用メモリ 69,924 KB
最終ジャッジ日時 2023-09-17 06:07:55
合計ジャッジ時間 5,863 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int n = koko.nextInt();
       long[] c = new long[n];
       long[] d = new long[n];
       long total = 0;
       long[] t = new long[n];
       for(int i = 0; i<n; i++){
           String c_string = koko.next();
           c[i] = Long.parseLong(c_string);
           String d_string = koko.next();
           d[i] = Long.parseLong(d_string);
           d[i] = d[i]%1000000007;
       
           if(c[i]%2==0){
               c[i] = (c[i]/2)%1000000007;
               t[i] = c[i]*d[i];
               total = total + t[i];
           }else{
               c[i] = ((c[i]+1)/2)%1000000007;
               t[i] = c[i]*d[i];
               total = total + t[i];
           }
       }
       total = total%1000000007;
       System.out.println(total);
    }
}
0