結果
| 問題 | No.662 スロットマシーン |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-25 15:40:36 |
| 言語 | Kuin (KuinC++ v.2021.9.17) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 821 bytes |
| 記録 | |
| コンパイル時間 | 1,929 ms |
| コンパイル使用メモリ | 169,920 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-05 16:45:58 |
| 合計ジャッジ時間 | 2,466 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
コンパイルメッセージ
out.cpp:676:14: warning: first argument in call to 'memset' is a pointer to non-trivially copyable type 'std::shared_ptr<Array_<char16_t>>' [-Wnontrivial-memcall]
676 | memset(r->B, 0, sizeof(T) * static_cast<std::size_t>(h + bufLen_<T>()));
| ^
out.cpp:688:9: note: in instantiation of function template specialization 'newArraysRec_<std::shared_ptr<Array_<std::shared_ptr<Array_<char16_t>>>>>::operator()<long long>' requested here
688 | return newArraysRec_<T>()(std::forward<A>(a)...);
| ^
out.cpp:1639:11: note: in instantiation of function template specialization 'newArrays_<std::shared_ptr<Array_<std::shared_ptr<Array_<char16_t>>>>, long long>' requested here
1639 | (k_am) = (newArrays_<type_(Array_<type_(Array_<char16_t>)>)>((5LL)));
| ^
out.cpp:676:14: note: explicitly cast the pointer to silence this warning
676 | memset(r->B, 0, sizeof(T) * static_cast<std::size_t>(h + bufLen_<T>()));
| ^
| (void*)
out.cpp:676:14: warning: first argument in call to 'memset' is a pointer to non-trivially copyable type 'std::shared_ptr<Dict_<long, long>>' [-Wnontrivial-memcall]
676 | memset(r->B, 0, sizeof(T) * static_cast<std::size_t>(h + bufLen_<T>()));
| ^
out.cpp:688:9: note: in instantiation of function template specialization 'newArraysRec_<std::shared_ptr<Array_<std::shared_ptr<Dict_<long, long>>>>>::operator()<long long>' requested here
688 | return newArraysRec_<T>()(std::forward<A>(a)...);
| ^
out.cpp:1647:11: note: in instantiation of function template specialization 'newArrays_<std::shared_ptr<Array_<std::shared_ptr<Dict_<long, long>>>>, long long>' requested here
1647 | (k_ax) = (newArrays_<type_(Array_<type_(Dict_<int64_t, int64_t>)>)>((3LL)));
|
ソースコード
func main()
var str: [][]char :: #[5][]char
var coin: []int :: #[5]int
var dic: dict<[]char, int> :: #dict<[]char, int>
for i(0, 4)
do str[i] :: cui@inputStr()
do coin[i] :: cui@inputInt()
do dic.add(str[i], i)
end for
var a: []dict<int, int> :: #[3]dict<int, int>
var n: []int :: #[3]int
for i(0, 2)
do n[i] :: cui@inputInt()
do a[i] :: #dict<int, int>
for(1, n[i])
var idx: int :: dic.get(cui@input(), &)
do a[i].add(idx, a[i].get(idx, &) + 1)
end for
end for
var ans: float :: 0.0
var nums: []int :: #[5]int
for i(0, 4)
do nums[i] :: 5 * a[0].get(i, &) * a[1].get(i, &) * a[2].get(i, &)
do ans :+ (nums[i] * coin[i]) $ float
end for
do ans :/ (n[0] * n[1] * n[2]) $ float
do cui@print("\{ans.toStrFmt(".6f")}\n")
for i(0, 4)
do cui@print("\{nums[i]}\n")
end for
end func