結果
問題 |
No.1280 Beyond C
|
ユーザー |
![]() |
提出日時 | 2020-11-06 22:24:25 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 124 ms / 2,000 ms |
コード長 | 682 bytes |
コンパイル時間 | 2,618 ms |
コンパイル使用メモリ | 199,072 KB |
最終ジャッジ日時 | 2025-01-15 20:57:32 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include <bits/stdc++.h> using namespace std; const ll INF=1e9+7; ll c; bool f(ll a,ll x){ if(x==INF) return true; else if(a*x>c) return true; else return false; } int main(){ ll n,m; cin>>n>>m>>c; vector<ll> A(n+1),B(m+2); rep(i,n) cin>>A[i+1]; rep(i,m) cin>>B[i+1]; B[m+1]=INF; sort(ALL(B)); ll cnt=0; for(int i=1;i<=n;i++){ int ng=0,ok=m+1; while(ok-ng>1){ int mid=ng+(ok-ng)/2; if(f(A[i],B[mid])) ok=mid; else ng=mid; } cnt+=m-ng; } cout<<fixed<<setprecision(10)<<(double)cnt/(n*m)<<endl; return 0; }