結果
| 問題 |
No.667 Mice's Luck(ネズミ達の運)
|
| コンテスト | |
| ユーザー |
AQUA16573837
|
| 提出日時 | 2018-04-03 19:31:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 102 ms / 2,000 ms |
| コード長 | 448 bytes |
| コンパイル時間 | 208 ms |
| コンパイル使用メモリ | 37,448 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 08:33:42 |
| 合計ジャッジ時間 | 1,303 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
main.cpp: In function ‘void solve()’:
main.cpp:19:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
19 | scanf("%s", s);
| ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h>
#include <algorithm>
#include <deque>
using namespace std;
using ll = long long;
void solve();
int main() {
solve();
#ifdef DBG
while (true);
#endif
}
//667
void solve() {
int len, oc = 0, xc = 0;
char s[100001];
scanf("%s", s);
for (len = 0; s[len] != 0; len++)
(s[len] == 'o' ? oc : xc)++;
for (int i = 0; i < len; i++) {
printf("%.13lf\n", (double)oc / (double)(oc + xc) * 100.);
(s[i] == 'o' ? oc : xc)--;
}
}
AQUA16573837