結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー tecchaxntecchaxn
提出日時 2018-03-23 22:25:49
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 1,691 ms
コンパイル使用メモリ 144,368 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-07 03:01:42
合計ジャッジ時間 3,025 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;

signed main()
{
    string s; cin>>s;
    int N=s.size();
    int ok=count(ALL(s),'o');
    int ng=count(ALL(s),'x');

    REP(i,N){
        double ans=(double)ok/(ok+ng);
        printf("%.20lf\n",ans);
        if(s[i]=='o') ok--;
        else ng--;
    }
}
0