結果

問題 No.1280 Beyond C
ユーザー higopon_higopon_
提出日時 2020-11-06 22:33:29
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 793 bytes
コンパイル時間 1,651 ms
コンパイル使用メモリ 169,812 KB
実行使用メモリ 4,752 KB
最終ジャッジ日時 2023-09-29 19:13:31
合計ジャッジ時間 3,418 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 52 ms
4,376 KB
testcase_16 AC 41 ms
4,376 KB
testcase_17 AC 50 ms
4,380 KB
testcase_18 AC 86 ms
4,752 KB
testcase_19 AC 86 ms
4,608 KB
testcase_20 AC 96 ms
4,596 KB
testcase_21 AC 94 ms
4,556 KB
testcase_22 AC 96 ms
4,540 KB
権限があれば一括ダウンロードができます

ソースコード

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