結果
問題 |
No.1280 Beyond C
|
ユーザー |
![]() |
提出日時 | 2020-11-03 19:39:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 100 ms / 2,000 ms |
コード長 | 914 bytes |
コンパイル時間 | 911 ms |
コンパイル使用メモリ | 81,240 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-22 09:10:35 |
合計ジャッジ時間 | 2,741 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#include <iostream> #include <iomanip> #include <vector> #include <cassert> #include <algorithm> #define rep(i,n) for(int i=0; i<(int)(n); i++) using namespace std; using LL = long long; const int Max_N = 1e5; const LL Max_C = 1e18; const LL Max_A = 1e9; int main(){ LL N, M, C; cin >> N >> M >> C; assert(1 <= N and N <= Max_N); assert(1 <= M and M <= Max_N); assert(1 <= C and C <= Max_C); vector<LL> a(N), b(M); rep(i,N) cin >> a[i]; rep(i,N) assert(1 <= a[i] and a[i] <= Max_A); rep(i,M) cin >> b[i]; rep(i,M) assert(1 <= b[i] and b[i] <= Max_A); sort(b.begin(),b.end()); double ans = 0; rep(i,N){ int left = -1, right = M; int mid = (left + right) / 2; while(right - left > 1){ if(a[i] * b[mid] > C) right = mid; else left = mid; mid = (left + right) / 2; } ans += M - right; } ans /= N * M; cout << setprecision(15) << ans << endl; return 0; }