結果
問題 |
No.662 スロットマシーン
|
ユーザー |
![]() |
提出日時 | 2020-03-04 22:32:44 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 1,128 bytes |
コンパイル時間 | 2,380 ms |
コンパイル使用メモリ | 84,208 KB |
最終ジャッジ日時 | 2025-01-09 04:29:02 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
#pragma GCC optimize("O3") #pragma GCC target("avx") #pragma GCC optimize("Ofast") #include <cctype> #include <cstdio> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define gc getchar_unlocked //#define gc _getchar_nolock inline void input(string& v) noexcept { for (char c = gc(); !isspace(c); c = gc()) v += c; } inline void input(int& v) noexcept { v = 0; char c = gc(); for (; isdigit(c); c = gc()) { v *= 10; v += c - '0'; } } inline void input(long long& v) noexcept { v = 0; char c = gc(); for (; isdigit(c); c = gc()) { v *= 10; v += c - '0'; } } string str[5]; long long coin[5], cnt[5]; int n[3]; int main() { rep(i, 5) { input(str[i]); input(coin[i]); cnt[i] = 5; } rep(i, 3) { input(n[i]); int cnt2[5] = {}; rep(j, n[i]) { string s; input(s); rep(k, 5) if (str[k] == s)++ cnt2[k]; } rep(j, 5) { cnt[j] *= cnt2[j]; } } long long a1 = 0, a2 = 1; rep(i, 5) a1 += cnt[i] * coin[i]; rep(i, 3) a2 *= n[i]; printf("%f\n", 1.0 * a1 / a2); rep(i, 5) printf("%lld\n", cnt[i]); }