結果

問題 No.662 スロットマシーン
ユーザー fal_rndfal_rnd
提出日時 2018-05-12 13:00:38
言語 Java19
(openjdk 21)
結果
AC  
実行時間 206 ms / 2,000 ms
コード長 710 bytes
コンパイル時間 2,917 ms
コンパイル使用メモリ 74,788 KB
実行使用メモリ 59,548 KB
最終ジャッジ日時 2023-09-10 18:20:59
合計ジャッジ時間 6,811 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,920 KB
testcase_01 AC 122 ms
56,072 KB
testcase_02 AC 127 ms
56,328 KB
testcase_03 AC 160 ms
56,292 KB
testcase_04 AC 166 ms
54,368 KB
testcase_05 AC 137 ms
55,848 KB
testcase_06 AC 168 ms
56,868 KB
testcase_07 AC 168 ms
57,312 KB
testcase_08 AC 190 ms
59,032 KB
testcase_09 AC 205 ms
59,424 KB
testcase_10 AC 202 ms
59,208 KB
testcase_11 AC 206 ms
59,388 KB
testcase_12 AC 206 ms
59,092 KB
testcase_13 AC 204 ms
59,360 KB
testcase_14 AC 201 ms
59,464 KB
testcase_15 AC 205 ms
59,476 KB
testcase_16 AC 120 ms
56,204 KB
testcase_17 AC 205 ms
59,548 KB
testcase_18 AC 205 ms
59,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main{
	static Scanner s=new Scanner(System.in);
	static int gInt(){
		return Integer.parseInt(s.next());
	}
	public static void main(String[] A){
		Map<String,Integer>map=new HashMap<>();
		int[]reward=new int[5];
		for(int i=0;i<5;++i) {
			map.put(s.next(),i);
			reward[i]=gInt();
		}
		long[]len=new long[3];
		long[][]count=new long[3][5];
		for(int i=0;i<3;++i)
			for(long j=len[i]=gInt();j>0;--j)
				count[i][map.get(s.next())]++;
		
		long prob=0;
		for(int i=0;i<5;++i)
			prob+=count[0][i]*count[1][i]*count[2][i]*reward[i];
		System.out.println(prob*5.0/(len[0]*len[1]*len[2]));
		for(int i=0;i<5;++i)
			System.out.println(count[0][i]*count[1][i]*count[2][i]*5);;
	}
}
0