結果

問題 No.146 試験監督(1)
ユーザー tsunabit
提出日時 2019-05-12 14:18:34
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 578 bytes
コンパイル時間 3,220 ms
コンパイル使用メモリ 75,016 KB
実行使用メモリ 54,432 KB
最終ジャッジ日時 2024-07-04 02:50:34
合計ジャッジ時間 4,377 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Scanner;

public class No146 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long count = 0;
        for(int i = 0; i < n; i++) {
        	long c = sc.nextInt();
        	long d = sc.nextInt();
        	if(c % 2 == 0) {
        		count += c/2 * d;
        	}else {
        		count += (c/2 + 1) * d;
        	}
        }
        System.out.println(count);
    }
}
0