結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー 007p99lupin007p99lupin
提出日時 2018-04-01 02:32:26
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 1,299 ms
コンパイル使用メモリ 145,024 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-08 10:25:05
合計ジャッジ時間 3,325 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const* argv[])
{
	string s;
	cin>>s;
	int len = s.size();
	float safe,dead,ans;
	safe = dead = 0;
	for (int i = 0; i < len; i++) {
		if(s[i]=='o'){
			safe+=1;
		}
		else{
			dead+=1;
		}
	}
	for (int i = 0; i < len; i++) {
		ans = (safe/(len-i))*100;
		cout<<ans<<endl;
		if(s[i]=='o'){
			safe -=1;
		}
		else{
			dead -=1;
		}
	}
	return 0;
}
0