結果

問題 No.146 試験監督(1)
ユーザー mitsuomitsuo
提出日時 2016-05-04 22:53:26
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 663 bytes
コンパイル時間 2,431 ms
コンパイル使用メモリ 75,528 KB
実行使用メモリ 73,396 KB
最終ジャッジ日時 2024-04-15 11:32:44
合計ジャッジ時間 5,837 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> input = new ArrayList<>();

		while (sc.hasNext()) {
			input.add(sc.nextLine());
		}

		System.out.println(solve(input));

		sc.close();
	}

	public static int solve(List<String> in) {
		int total = 0;
		for (int i = 1; i < in.size(); i++) {
			int s = Integer.valueOf(in.get(i).split(" ")[0]);
			int k = Integer.valueOf(in.get(i).split(" ")[1]);
			if (s % 2 == 0) {
				total += (s / 2) * k;
			} else {
				total += (s + 1) / 2 * k;
			}
		}
		return total;
	}
}
0