結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー ilplrrilplrr
提出日時 2018-03-23 22:36:05
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 1,270 ms
コンパイル使用メモリ 158,792 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-24 21:50:24
合計ジャッジ時間 3,327 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main()
{
    string s;
    cin >> s;

    int o = 0, x = 0, n = s.size();
    for (int i = 0; i < n; i++) (s[i] == 'o' ? o : x)++;

    for (int i = 0;  i < n; i++) {
        printf("%.9f\n", 100.0 * o / (o + x));
        (s[i] == 'o' ? o : x)--;
    }

    return 0;
}
0