結果
| 問題 |
No.1280 Beyond C
|
| コンテスト | |
| ユーザー |
platinum
|
| 提出日時 | 2020-05-18 19:01:31 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 2,000 ms |
| コード長 | 914 bytes |
| コンパイル時間 | 893 ms |
| コンパイル使用メモリ | 81,700 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-29 06:10:47 |
| 合計ジャッジ時間 | 3,026 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cassert>
#define rep(i,n) for(int i=0; i<(int)(n); i++)
using namespace std;
using LL = long long;
const int Max_Num=1e5;
const LL Max_C=1e18;
const int Max_AB=1e9;
int main(){
LL N, M, C;
cin >> N >> M >> C;
assert(N>=1 && N<=Max_Num);
assert(M>=1 && M<=Max_Num);
assert(C>=1 && C<=Max_C);
vector<LL> A(N), B(M);
rep(i,N){
LL a;
cin >> a;
assert(a>=1 && a<=Max_AB);
A[i]=a;
}
rep(i,M){
LL b;
cin >> b;
assert(b>=1 && b<=Max_AB);
B[i]=b;
}
sort(B.begin(),B.end());
double ans=0;
rep(i,N){
LL a=A[i];
int left=-1, right=B.size();
while(right - left > 1){
int mid = left + (right - left)/2;
if(a * B[mid] > C) right = mid;
else left = mid;
}
ans += B.size() - right;
}
cout << setprecision(10) << ans/(N*M) << endl;
return 0;
}
platinum