結果
問題 |
No.667 Mice's Luck(ネズミ達の運)
|
ユーザー |
![]() |
提出日時 | 2023-08-19 16:16:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 69 ms / 2,000 ms |
コード長 | 417 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 77,028 KB |
最終ジャッジ日時 | 2025-02-16 11:37:16 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include<iostream> #include<map> #include<vector> #include <algorithm> using namespace std; int main() { string s; cin >> s; int y = 0, n = 0; for (int i = 0; i < s.size(); i++){ if (s[i] == 'o') y++; else n++; } for (int i = 0; i < s.size(); i++){ if (i == 0); else if (s[i-1] == 'o') y--; else n--; printf("%.7f\n", (y*1./(y+n))*100); } }