結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー BwambocosBwambocos
提出日時 2018-03-23 22:50:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 248 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 1,490 ms
コンパイル使用メモリ 165,504 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-07 03:44:52
合計ジャッジ時間 3,319 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

std::string S;
int safe, dang;

int main()
{
	in >> S;
	for (auto c : S) (c == 'o' ? safe : dang) += 1;
	out << std::fixed << std::setprecision(13);
	for (auto c : S)
	{
		out << 100.*safe / (safe + dang) << std::endl;
		(c == 'o' ? safe : dang) -= 1;
	}
	return 0;
}
0