結果
| 問題 |
No.1280 Beyond C
|
| コンテスト | |
| ユーザー |
platinum
|
| 提出日時 | 2020-05-20 17:25:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 2,000 ms |
| コード長 | 920 bytes |
| コンパイル時間 | 861 ms |
| コンパイル使用メモリ | 82,916 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-29 06:11:32 |
| 合計ジャッジ時間 | 2,453 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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(A.begin(),A.end(),greater<LL>());
sort(B.begin(),B.end());
double ans=0;
int i=0, num=0;
while(i<N){
LL a=A[i];
for(int j=num; j<M; j++){
LL b=B[j];
if(a*b>C){
ans+=M-j;
i++, num=j;
break;
}
if(j==M-1) i=N;
}
}
cout << setprecision(10) << ans/(N*M) << endl;
return 0;
}
platinum