結果
問題 |
No.667 Mice's Luck(ネズミ達の運)
|
ユーザー |
|
提出日時 | 2020-09-13 16:52:38 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 221 ms / 2,000 ms |
コード長 | 705 bytes |
コンパイル時間 | 3,488 ms |
コンパイル使用メモリ | 129,484 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-13 02:24:53 |
合計ジャッジ時間 | 3,474 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <unordered_map> using namespace std; #define ll long long #define all(v) v.begin(),v.end() #define bootstrap ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); void solve() { string boxes; cin >> boxes; double o, x = 0; for (char &ch:boxes) { if (ch == 'x') { x++; } } o = boxes.length() - x; cout.precision(10); for (int i = 0; i < boxes.length(); ++i) { cout << 100 * o / (x + o) << endl; if(boxes.at(i) == 'o') { o --; } else { x --; } } } int main() { bootstrap; solve(); }