結果
問題 |
No.1280 Beyond C
|
ユーザー |
|
提出日時 | 2020-12-10 13:33:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 101 ms / 2,000 ms |
コード長 | 587 bytes |
コンパイル時間 | 1,539 ms |
コンパイル使用メモリ | 171,964 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-19 20:32:30 |
合計ジャッジ時間 | 3,542 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair<int, int> int main() { ll N, M, C; cin >> N >> M >> C; ll a[N], b[M]; rep(i, N) cin >> a[i]; rep(i, M) cin >> b[i]; sort(a, a+N); sort(b, b+M); ll p = 0; // a[i] に対して a[i] * b[j] > C となる j がいくつあるかを lower_bound を用いて求める. rep(i, N) { ll t = lower_bound(b, b+M, C/a[i]+1) - b; p += M-t; } double ans = (double)p/(M*N); cout << fixed << setprecision(10) << ans << endl; }