結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー DameningenDameningen
提出日時 2018-03-23 22:32:19
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 922 bytes
コンパイル時間 694 ms
コンパイル使用メモリ 90,360 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-07 03:06:48
合計ジャッジ時間 3,043 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<cstring>
#include<string>
#include<vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<complex>
#include<sstream>
#include<climits>
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define all(X) (X).begin(),(X).end()
#define pb push_back
#define mk make_pair
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int main() {
  string s;
  cin >> s;

  int n = s.size();
  int onum = 0, xnum = 0;
  rep(i,n) {
    if (s[i] == 'o') ++onum;
    else ++xnum;
  }

  for (int i = 0; i < n; ++i) {
    printf("%.10f\n", (double)onum / (n-i) * 100);
    if (s[i] == 'o') --onum;
  }

  return 0;
}
0