結果
問題 | No.667 Mice's Luck(ネズミ達の運) |
ユーザー |
![]() |
提出日時 | 2018-03-23 23:37:25 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 226 ms / 2,000 ms |
コード長 | 449 bytes |
コンパイル時間 | 555 ms |
コンパイル使用メモリ | 66,736 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 22:59:19 |
合計ジャッジ時間 | 3,099 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <iomanip> using namespace std; string S; int main(){ cin >> S; int safe=0, dang=0; for(int i=0; i<S.size(); i++){ if(S[i]=='o') safe++; else dang++; } for(int i=0; i<S.size(); i++){ double res=(double)safe/(safe+dang)*100; cout << setprecision(10) << res << endl; if(S[i]=='o') safe--; else dang--; } }