結果

問題 No.662 スロットマシーン
ユーザー dustnn0dustnn0
提出日時 2018-03-10 00:56:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 815 bytes
コンパイル時間 2,261 ms
コンパイル使用メモリ 177,032 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-19 07:39:53
合計ジャッジ時間 2,702 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 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 2 ms
5,376 KB
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,a) for(int i=0;i<(a);i++)
#define MOD 1000000007

int main(){
  vector<pair<string,int>> value(5);
  rep(i,5) cin>>value[i].first>>value[i].second;
  vector<map<string,int>> v(3);
  rep(i,3) rep(j,5){
    string name=value[j].first;
    v[i].insert(make_pair(name,0));
  }
  int n[3];
  rep(i,3){
    cin>>n[i];
    rep(j,n[i]){
      string s; cin>>s;
      v[i][s]++;
    }
  }
  int num[5];
  rep(i,5){
    string name=value[i].first;
    int tmp=5;
    rep(j,3){
      tmp*=v[j][name];
    }
    num[i]=tmp;
  }
  double ans=0.0;
  rep(i,5){
    ans+=value[i].second*num[i];
  }
  rep(i,3) ans/=(n[i]*1.0);
  cout<<setprecision(10);
  cout<<ans<<endl;
  rep(i,5) cout<<num[i]<<endl;
  return 0;
}
0