結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー ngtkanangtkana
提出日時 2020-02-27 14:06:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 254 bytes
コンパイル時間 1,525 ms
コンパイル使用メモリ 164,980 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-21 16:56:11
合計ジャッジ時間 3,000 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
6,944 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 166 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
int main(){
    std::string s;std::cin>>s;
    int a=0;
    for(char c:s)a+=c=='o';
    int b=s.length()-a;
    for(char c:s){
        std::cout<<std::setprecision(12)<<(double)a/(a+b)<<std::endl;
        (c=='o'?a:b)--;
    }
}

0