結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー pumbaacavepumbaacave
提出日時 2020-09-13 16:41:41
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 710 bytes
コンパイル時間 881 ms
コンパイル使用メモリ 92,024 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-03 21:09:30
合計ジャッジ時間 2,624 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_map>

using namespace std;

#define ll long long
#define all(v) v.begin(),v.end()
#define bootstrap ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);


void solve() {
    string boxes;
    cin >> boxes;
    double o, x = 0;
    for (char &ch:boxes) {
        if (ch == 'x') {
            x++;
        }
    }
    o = boxes.length() - x;
    for (int i = 0; i < boxes.length() - 1; ++i) {
        cout << o / (x + o) << endl;
        if(boxes.at(i) == 'o') {
            o --;
        } else {
            x --;
        }
    }

}

int main() {
    bootstrap;
    int t;
    t = 1;//cin>>t;
    solve();
}
0