結果

問題 No.667 Mice's Luck(ネズミ達の運)
コンテスト
ユーザー kichirb3
提出日時 2018-04-02 21:06:55
言語 C++14
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 105 ms / 2,000 ms
+ 902µs
コード長 576 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 408 ms
コンパイル使用メモリ 96,304 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-30 09:10:41
合計ジャッジ時間 2,712 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

// 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