結果
問題 | No.667 Mice's Luck(ネズミ達の運) |
ユーザー |
![]() |
提出日時 | 2020-07-14 21:36:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 230 ms / 2,000 ms |
コード長 | 464 bytes |
コンパイル時間 | 1,672 ms |
コンパイル使用メモリ | 168,212 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-18 20:18:29 |
合計ジャッジ時間 | 4,263 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <bits/stdc++.h>#define PI 3.14159265359using namespace std;int main() {string S;cin >> S;int circle, cross, sum;double ans;circle = 0;cross = 0;for (int i = 0; i < S.size(); i++) {if (S.at(i) == 'o') circle++;else cross++;}for (int i = 0; i < S.size(); i++) {sum = circle + cross;ans = (double)circle / sum;cout << fixed << setprecision(10) << ans * 100 << endl;if (S.at(i) == 'o') circle--;else cross--;}}