結果

問題 No.146 試験監督(1)
ユーザー mitsuomitsuo
提出日時 2016-05-04 22:52:34
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 707 bytes
コンパイル時間 2,944 ms
コンパイル使用メモリ 85,580 KB
実行使用メモリ 72,860 KB
最終ジャッジ日時 2024-04-15 11:31:41
合計ジャッジ時間 6,481 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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) {
		in = new ArrayList<>(in);
		in.remove(0);
		int total = 0;
		for (int i = 0; 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