結果
問題 | No.210 探し物はどこですか? |
ユーザー |
|
提出日時 | 2016-12-23 01:38:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 126 ms / 2,000 ms |
コード長 | 527 bytes |
コンパイル時間 | 1,883 ms |
コンパイル使用メモリ | 175,448 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 15:00:38 |
合計ジャッジ時間 | 7,898 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#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 < 1000000; 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); }