結果

問題 No.662 スロットマシーン
ユーザー YamaKasaYamaKasa
提出日時 2018-10-01 13:49:27
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,536 bytes
コンパイル時間 3,988 ms
コンパイル使用メモリ 87,400 KB
実行使用メモリ 59,172 KB
最終ジャッジ日時 2024-04-20 14:10:52
合計ジャッジ時間 7,769 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
41,548 KB
testcase_01 AC 136 ms
41,236 KB
testcase_02 AC 143 ms
41,548 KB
testcase_03 AC 173 ms
41,916 KB
testcase_04 AC 190 ms
42,972 KB
testcase_05 AC 154 ms
41,852 KB
testcase_06 AC 187 ms
43,448 KB
testcase_07 AC 200 ms
43,152 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 136 ms
41,376 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, Long> map = new HashMap<String, Long>();
		String[]key = new String[5];
		for(int i = 0; i < 5; i++) {
			String s = scan.next();
			long t = scan.nextInt();
			map.put(s, t);
			key[i] = s;
		}
		int n1 = scan.nextInt();
		String[]A = new String[n1];
		Map<String, Long> mapA = new HashMap<String, Long>();
		for(int i = 0; i < n1; i++) {
			A[i] = scan.next();
			mapA.merge(A[i], 1L, (val1, val2) -> val1 + val2);
		}
		int n2 = scan.nextInt();
		Map<String, Long> mapB = new HashMap<String, Long>();
		String[]B = new String[n2];
		for(int i = 0; i < n2; i++) {
			B[i] = scan.next();
			mapB.merge(B[i], 1L, (val1, val2) -> val1 + val2);
		}
		int n3 = scan.nextInt();
		String[]C = new String[n3];
		Map<String, Long> mapC = new HashMap<String, Long>();
		for(int i = 0; i < n3; i++) {
			C[i] = scan.next();
			mapC.merge(C[i], 1L, (val1, val2) -> val1 + val2);
		}
		scan.close();
		long sum = 0;
		long[]U = new long[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(long i : U) {
			System.out.println(i);
		}
	}
}
0