結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー chacoder1chacoder1
提出日時 2021-05-11 20:49:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 260 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 2,112 ms
コンパイル使用メモリ 202,152 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 02:29:12
合計ジャッジ時間 5,652 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
#define int long long

signed main(){
  string s;
  cin>>s;
  int len=s.length();
  int n=len;
  int cnt=0;
  rep(i,n){
    if(s[i]=='x') cnt++;
  }
  int good=len-cnt;
  int bad=cnt;
  rep(i,n){
    //cout<<good<<" "<<good+bad<<endl;
    cout<<setprecision(18)<<100*(double)good/(good+bad)<<endl;
    if(s[i]=='x') bad--;
    else good--;
  }
  return 0;
}

0