結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー ngtkanangtkana
提出日時 2020-02-27 14:07:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 246 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 2,688 ms
コンパイル使用メモリ 163,064 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-21 16:56:17
合計ジャッジ時間 4,154 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 4 ms
6,940 KB
testcase_05 AC 25 ms
6,940 KB
testcase_06 AC 118 ms
5,376 KB
testcase_07 AC 246 ms
5,376 KB
testcase_08 AC 170 ms
5,376 KB
testcase_09 AC 178 ms
5,376 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)100*a/(a+b)<<std::endl;
        (c=='o'?a:b)--;
    }
}

0