結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー mytkyt
提出日時 2018-03-29 15:57:15
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 1,079 ms
コンパイル使用メモリ 57,008 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-25 23:48:28
合計ジャッジ時間 2,594 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstring>

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){
      cout << (double)alive/(alive + dead)*100 << endl;
    }else{
      cout << 0 << endl;
    }
    if(s[i]=='o'){
      alive--;
    }else{
      dead--;
    }
  }

  return 0;
}
0