結果
| 問題 |
No.662 スロットマシーン
|
| コンテスト | |
| ユーザー |
fal_rnd
|
| 提出日時 | 2018-05-12 13:00:38 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 225 ms / 2,000 ms |
| コード長 | 710 bytes |
| コンパイル時間 | 2,287 ms |
| コンパイル使用メモリ | 78,276 KB |
| 実行使用メモリ | 57,704 KB |
| 最終ジャッジ日時 | 2024-06-28 09:33:08 |
| 合計ジャッジ時間 | 6,978 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
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);;
}
}
fal_rnd