結果

問題 No.586 ダブルブッキング
ユーザー YOSHIYOSHI
提出日時 2021-03-20 15:19:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 675 bytes
コンパイル時間 3,337 ms
コンパイル使用メモリ 74,792 KB
実行使用メモリ 50,284 KB
最終ジャッジ日時 2024-05-01 02:08:41
合計ジャッジ時間 4,174 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
50,252 KB
testcase_01 AC 45 ms
49,856 KB
testcase_02 AC 47 ms
50,284 KB
testcase_03 AC 46 ms
50,004 KB
testcase_04 AC 45 ms
50,164 KB
testcase_05 AC 49 ms
50,256 KB
testcase_06 AC 45 ms
50,268 KB
testcase_07 AC 46 ms
49,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;

public class No00000586_Main {
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static void main(String[] args) throws IOException {
		int p1 = Integer.parseInt(br.readLine());
		int p2 = Integer.parseInt(br.readLine());
		int n = Integer.parseInt(br.readLine());
		Set<String> s = new HashSet<String>();
		int cnt = 0;
		for(int i = 0; i < n; i++) {
			String r = br.readLine();
			if(s.contains(r)) {
				cnt++;
			} else {
				s.add(r);
			}
		}
		System.out.println((p1 + p2) * cnt);
	}
}
0