結果

問題 No.146 試験監督(1)
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-06 09:14:53
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 780 bytes
コンパイル時間 1,887 ms
コンパイル使用メモリ 71,772 KB
実行使用メモリ 69,740 KB
最終ジャッジ日時 2023-09-17 06:06:36
合計ジャッジ時間 5,092 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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];
       for(int i = 0; i<n; i++){
           c[i] = koko.nextLong();
           d[i] = koko.nextLong();
       }
       long total = 0;
       long[] t = new long[n];
       for(int i =0; i<n; i++){
           if(i%2==0){
               t[i] = c[i]*d[i]/2;
               t[i] = t[i]%1000000007;
               total = total + t[i];
           }else{
               t[i] = (c[i]+1)*d[i]/2;
               t[i] = t[i]%1000000007;
               total = total + t[i];
           }
       }
       System.out.println(total);
    }
}

0