結果

問題 No.1280 Beyond C
ユーザー higopon_higopon_
提出日時 2020-11-06 22:33:29
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 793 bytes
コンパイル時間 1,588 ms
コンパイル使用メモリ 172,520 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-22 13:18:22
合計ジャッジ時間 3,206 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define PI acos(-1)
#define all(v) v.begin(),v.end()

typedef  long long ll;
ll gcd(ll x,ll y){
   if(y==0) return x;
   else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
   return x/gcd(x,y)*y;
}



int main(){
   ll n,m,c;
   cin>>n>>m>>c;
   vector<ll> a(n);
   vector<ll> b(m);
   rep(i,n){
      cin>>a[i];
   }
   rep(i,m){
      cin>>b[i];
   }
   ll bunbo=n*m;
   ll bunsi=0;
   sort(all(b));
   
   rep(i,n){
      ll x=a[i];
      long double y=(long double)(c)/(long double)(x);
      auto itr=upper_bound(all(b),y);
      bunsi+=b.end()-itr;
      //cout<<b.end()-itr<<endl;
   }
   long double ans=(long double)(bunsi)/(long double)(bunbo);
   cout<<setprecision(15)<<ans<<endl;

   
   
return 0;
}
0