結果
問題 |
No.667 Mice's Luck(ネズミ達の運)
|
ユーザー |
![]() |
提出日時 | 2018-04-02 21:06:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 253 ms / 2,000 ms |
コード長 | 576 bytes |
コンパイル時間 | 668 ms |
コンパイル使用メモリ | 77,348 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 06:45:42 |
合計ジャッジ時間 | 3,502 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
// No.667 Mice's Luck(ネズミ達の運) // https://yukicoder.me/problems/no/667 // #include <iostream> #include <string> #include <cmath> #include <iomanip> #include <algorithm> using namespace std; int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); string s; cin >> s; int total = s.size(); int safe = count(s.begin(), s.end(), 'o'); for (int i = 0; i < total; ++i) { cout << fixed << setprecision(15) << static_cast<double>(safe) / (total - i) * 100 << endl; if (s[i] == 'o') --safe; } }