結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー kichirb3kichirb3
提出日時 2018-04-02 21:06:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 252 ms / 2,000 ms
コード長 576 bytes
コンパイル時間 605 ms
コンパイル使用メモリ 76,212 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 13:36:05
合計ジャッジ時間 3,515 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 4 ms
4,380 KB
testcase_05 AC 27 ms
4,380 KB
testcase_06 AC 128 ms
4,380 KB
testcase_07 AC 252 ms
4,376 KB
testcase_08 AC 188 ms
4,376 KB
testcase_09 AC 177 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// 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;
    }
}
0