結果
問題 | No.662 スロットマシーン |
ユーザー | yuruhiya |
提出日時 | 2020-03-04 22:32:44 |
言語 | C++17 (gcc 13.2.0 + boost 1.83.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,128 bytes |
コンパイル時間 | 533 ms |
コンパイル使用メモリ | 55,280 KB |
最終ジャッジ日時 | 2024-04-22 01:55:49 |
合計ジャッジ時間 | 908 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/13.2.0/include/c++/13/string:43, from main.cpp:6: /home/linuxbrew/.linuxbrew/Cellar/gcc/13.2.0/include/c++/13/bits/allocator.h: In destructor 'std::__cxx11::basic_string<char>::_Alloc_hider::~_Alloc_hider()': /home/linuxbrew/.linuxbrew/Cellar/gcc/13.2.0/include/c++/13/bits/allocator.h:184:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = char]': target specific option mismatch 184 | ~allocator() _GLIBCXX_NOTHROW { } | ^ In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/13.2.0/include/c++/13/string:54: /home/linuxbrew/.linuxbrew/Cellar/gcc/13.2.0/include/c++/13/bits/basic_string.h:181:14: note: called from here 181 | struct _Alloc_hider : allocator_type // TODO check __is_final | ^~~~~~~~~~~~
ソースコード
#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]); }