結果
問題 | No.1280 Beyond C |
ユーザー |
|
提出日時 | 2020-11-07 17:35:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 859 bytes |
コンパイル時間 | 805 ms |
コンパイル使用メモリ | 87,980 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-22 14:38:18 |
合計ジャッジ時間 | 2,329 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 17 |
ソースコード
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; #define MOD 1000000007 int main() { int n, m; cin >> n >> m; ll c; cin >> c; vector<ll> a(n), b(m + 2); for (int i = 0; i < n; ++i) { cin >> a[i]; } for (int i = 1; i <= m; ++i) { cin >> b[i]; } b[0] = 0, b[m + 1] = 1e18 + 1; ll win = 0; sort(b.begin(), b.end()); for (int i = 0; i < n; ++i) { int ok = n + 1, ng = 0; while (1 < abs(ok - ng)) { int mid = (ok + ng) / 2; if (c < a[i] * b[mid]) { ok = mid; } else { ng = mid; } } win += n - ok + 1; } printf("%.15f\n", (double)(win) / (n * m)); return 0; }