結果
| 問題 |
No.667 Mice's Luck(ネズミ達の運)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-01 23:37:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 237 ms / 2,000 ms |
| コード長 | 472 bytes |
| コンパイル時間 | 612 ms |
| コンパイル使用メモリ | 73,132 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-18 09:03:32 |
| 合計ジャッジ時間 | 3,288 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#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)*100 << endl;
if(s[i]=='o') {
cnt_o--;
}
else {
cnt_x--;
}
}
}