結果
| 問題 |
No.210 探し物はどこですか?
|
| コンテスト | |
| ユーザー |
mayoko_
|
| 提出日時 | 2015-05-16 00:27:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 967 bytes |
| コンパイル時間 | 1,299 ms |
| コンパイル使用メモリ | 163,552 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 04:37:27 |
| 合計ジャッジ時間 | 2,666 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 WA * 12 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
double p[1111], q[1111], r[1111];
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> 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.push(make_pair(p[i]*q[i], i));
}
double ans = 0;
for (int i = 1; i < 100000; i++) {
auto now = que.top(); que.pop();
ans += now.first * i;
double next = now.first * (1-q[now.second]);
que.push(make_pair(next, now.second));
}
printf("%.10lf\n", ans);
return 0;
}
mayoko_