結果
問題 | No.667 Mice's Luck(ネズミ達の運) |
ユーザー | tecchaxn |
提出日時 | 2018-03-23 22:27:41 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 133 ms / 2,000 ms |
コード長 | 408 bytes |
コンパイル時間 | 1,258 ms |
コンパイル使用メモリ | 158,776 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 21:45:09 |
合計ジャッジ時間 | 3,824 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include<bits/stdc++.h> #define REP(i,n) for(int i=0;i<(n);i++) #define ALL(v) (v).begin(),(v).end() #define int long long using namespace std; signed main() { string s; cin>>s; int N=s.size(); int ok=count(ALL(s),'o'); int ng=count(ALL(s),'x'); REP(i,N){ double ans=(double)ok/(ok+ng); printf("%.20lf\n",ans*100); if(s[i]=='o') ok--; else ng--; } }