結果
問題 | No.210 探し物はどこですか? |
ユーザー | y_mazun |
提出日時 | 2015-05-15 23:17:06 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 733 ms / 2,000 ms |
コード長 | 662 bytes |
コンパイル時間 | 422 ms |
コンパイル使用メモリ | 49,152 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-06 04:15:30 |
合計ジャッジ時間 | 25,876 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
コンパイルメッセージ
main.cpp: In function ‘int getInt()’: main.cpp:5:34: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | inline int getInt(){ int s; scanf("%d", &s); return s; } | ~~~~~^~~~~~~~~~
ソースコード
#define REP(i,n) for(int i=0; i<(int)(n); i++) #include <queue> #include <cstdio> inline int getInt(){ int s; scanf("%d", &s); return s; } #include <set> using namespace std; int main(){ const int n = getInt(); vector<int> p(n); vector<int> q(n); REP(i,n) p[i] = getInt(); REP(i,n) q[i] = getInt(); priority_queue<pair<double, double> > pq; REP(i,n) pq.push(make_pair(p[i] / 1000.0 * q[i] / 100.0, q[i] / 100.0)); double ans = 0; REP(i,5000000){ const pair<double, double> d = pq.top(); pq.pop(); ans += (i + 1) * d.first; pq.push(make_pair(d.first * (1 - d.second), d.second)); } printf("%.10f\n", ans); return 0; }