結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー toto6114
提出日時 2019-07-01 23:37:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 468 bytes
コンパイル時間 516 ms
コンパイル使用メモリ 72,272 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-18 09:02:49
合計ジャッジ時間 1,824 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;
int main() {
  double cnt_o=0,cnt_x=0;
  string s;
  cin >> s;
  for(int i=0; i<s.size(); i++) {
      if(s[i]=='o') {
          cnt_o++;
      }
      else {
          cnt_x++;
      }
  }
  for(int i=0; i<s.size(); i++) {
      cout << fixed << setprecision(10) << cnt_o/(cnt_o+cnt_x) << endl;
      if(s[i]=='o') {
          cnt_o--;
      }
      else {
          cnt_x--;
      }
  }
}
0