結果
問題 |
No.210 探し物はどこですか?
|
ユーザー |
|
提出日時 | 2016-12-23 01:38:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 525 bytes |
コンパイル時間 | 2,014 ms |
コンパイル使用メモリ | 175,948 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 15:00:17 |
合計ジャッジ時間 | 3,859 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 28 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<double> p(n), q(n); for (int i = 0; i < n; i++) { cin >> p[i]; p[i] /= 1000; } for (int i = 0; i < n; i++) { cin >> q[i]; q[i] /= 100; } priority_queue<pair<double, int>> que; for (int i = 0; i < n; i++) { que.emplace(p[i] * q[i], i); } double E = 0; for (int i = 1; i < 10000; i++) { double x; int y; tie(x, y) = que.top(); que.pop(); E += i * x; que.emplace(x * (1 - q[y]), y); } printf("%.20f\n", E); }