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