結果
問題 | No.667 Mice's Luck(ネズミ達の運) |
ユーザー |
![]() |
提出日時 | 2018-06-22 22:58:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 73 ms / 2,000 ms |
コード長 | 507 bytes |
コンパイル時間 | 1,425 ms |
コンパイル使用メモリ | 165,908 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 18:08:19 |
合計ジャッジ時間 | 3,413 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){string str;int i, surv = 0, death = 0, n;double P;cin >> str;n = str.size();for(i = 0; i < n; i++){if(str[i] == 'o'){surv++;}else{death++;}}for(i = 0; i < n ; i++){P = (double)surv/(surv + death);if(str[i] == 'o'){surv--;}else{death--;}printf("%.7f\n", P*100);}return 0;}