結果
問題 | No.667 Mice's Luck(ネズミ達の運) |
ユーザー |
|
提出日時 | 2018-05-11 23:31:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 106 ms / 2,000 ms |
コード長 | 443 bytes |
コンパイル時間 | 571 ms |
コンパイル使用メモリ | 65,496 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-28 09:03:47 |
合計ジャッジ時間 | 1,932 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream>#include <stdio.h>#include <string>using namespace std;int main(int argc, char* argv[]){string s;cin>>s;int o=0;int x=0;int i;for (i=0;i<s.length();i++){if (s[i]=='o'){o++;}else{x++;}}double save=0.0;for (i=0;i<s.length();i++){if (o==0){save=0.0;}else{save=100.0*o/(o+x);if (s[i]=='o'){o--;}else{x--;}}printf("%.13lf\n",save);}return 0;}