結果
問題 | No.210 探し物はどこですか? |
ユーザー |
![]() |
提出日時 | 2015-05-15 23:16:33 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 661 bytes |
コンパイル時間 | 407 ms |
コンパイル使用メモリ | 49,152 KB |
実行使用メモリ | 6,940 KB |
最終ジャッジ日時 | 2024-07-06 04:14:56 |
合計ジャッジ時間 | 3,868 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 42 WA * 1 |
コンパイルメッセージ
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,500000){ 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; }