結果
問題 | No.667 Mice's Luck(ネズミ達の運) |
ユーザー |
|
提出日時 | 2018-03-29 16:09:14 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 99 ms / 2,000 ms |
コード長 | 502 bytes |
コンパイル時間 | 404 ms |
コンパイル使用メモリ | 57,388 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-25 23:49:09 |
合計ジャッジ時間 | 1,580 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include<iostream>#include<stdio.h>using namespace std;int main(){string s;cin >> s;int l=0,alive=0,dead=0;while(1){if(s[l]=='o'){alive++;l++;}else if(s[l]=='x'){dead++;l++;}else{break;}}for(int i=0;i<l;i++){if((alive + dead)!=0){printf("%.13f\n",(double)alive/(alive + dead)*100);}else{printf("%.13f\n",0.0);}if(s[i]=='o'){alive--;}else{dead--;}}return 0;}