結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー IchimiyaIchimiya
提出日時 2020-07-14 21:28:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 435 bytes
コンパイル時間 1,392 ms
コンパイル使用メモリ 166,868 KB
実行使用メモリ 10,528 KB
最終ジャッジ日時 2024-04-29 15:22:45
合計ジャッジ時間 5,386 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,832 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 5 ms
5,376 KB
testcase_05 AC 175 ms
5,376 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
	}
}
0