結果
問題 |
No.667 Mice's Luck(ネズミ達の運)
|
ユーザー |
![]() |
提出日時 | 2021-05-11 20:48:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 461 bytes |
コンパイル時間 | 1,963 ms |
コンパイル使用メモリ | 192,736 KB |
最終ジャッジ日時 | 2025-01-21 10:04:48 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 8 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) typedef long long ll; #define int long long signed main(){ string s; cin>>s; int len=s.length(); int n=len; int cnt=0; rep(i,n){ if(s[i]=='x') cnt++; } int good=len-cnt; int bad=cnt; rep(i,n){ //cout<<good<<" "<<good+bad<<endl; cout<<setprecision(18)<<(double)good/(good+bad)<<endl; if(s[i]=='x') bad--; else good--; } return 0; }