結果

問題 No.662 スロットマシーン
ユーザー YamaKasaYamaKasa
提出日時 2018-10-01 13:46:35
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,552 bytes
コンパイル時間 2,207 ms
コンパイル使用メモリ 88,184 KB
実行使用メモリ 58,776 KB
最終ジャッジ日時 2024-04-20 14:10:43
合計ジャッジ時間 6,433 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
41,484 KB
testcase_01 AC 108 ms
41,616 KB
testcase_02 AC 123 ms
41,464 KB
testcase_03 AC 153 ms
42,140 KB
testcase_04 AC 171 ms
42,936 KB
testcase_05 AC 135 ms
41,800 KB
testcase_06 AC 169 ms
43,056 KB
testcase_07 AC 165 ms
42,976 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 123 ms
41,492 KB
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		Map<String, Integer> map = new HashMap<String, Integer>();
		String[]key = new String[5];
		for(int i = 0; i < 5; i++) {
			String s = scan.next();
			int t = scan.nextInt();
			map.put(s, t);
			key[i] = s;
		}
		int n1 = scan.nextInt();
		String[]A = new String[n1];
		Map<String, Integer> mapA = new HashMap<String, Integer>();
		for(int i = 0; i < n1; i++) {
			A[i] = scan.next();
			mapA.merge(A[i], 1, (val1, val2) -> val1 + val2);
		}
		int n2 = scan.nextInt();
		Map<String, Integer> mapB = new HashMap<String, Integer>();
		String[]B = new String[n2];
		for(int i = 0; i < n2; i++) {
			B[i] = scan.next();
			mapB.merge(B[i], 1, (val1, val2) -> val1 + val2);
		}
		int n3 = scan.nextInt();
		String[]C = new String[n3];
		Map<String, Integer> mapC = new HashMap<String, Integer>();
		for(int i = 0; i < n3; i++) {
			C[i] = scan.next();
			mapC.merge(C[i], 1, (val1, val2) -> val1 + val2);
		}
		scan.close();
		long sum = 0;
		int[]U = new int[5];
		for(int i = 0; i < 5; i++) {
			if(mapA.containsKey(key[i]) && mapB.containsKey(key[i]) && mapC.containsKey(key[i])) {
				sum += 5 * map.get(key[i]) * mapA.get(key[i]) * mapB.get(key[i]) * mapC.get(key[i]);
				U[i] = 5 * mapA.get(key[i]) * mapB.get(key[i]) * mapC.get(key[i]);
			}
		}
		double E = (double) sum / (n1 * n2 * n3);
		System.out.println(E);
		for(int i : U) {
			System.out.println(i);
		}
	}
}
0