結果

問題 No.1280 Beyond C
ユーザー higopon_higopon_
提出日時 2020-11-06 22:10:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 742 bytes
コンパイル時間 1,813 ms
コンパイル使用メモリ 169,864 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-29 18:51:00
合計ジャッジ時間 3,243 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,384 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 50 ms
4,380 KB
testcase_16 AC 40 ms
4,376 KB
testcase_17 AC 49 ms
4,376 KB
testcase_18 AC 83 ms
4,376 KB
testcase_19 WA -
testcase_20 AC 92 ms
4,376 KB
testcase_21 AC 91 ms
4,380 KB
testcase_22 AC 92 ms
4,376 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<int> a(n);
   vector<int> 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){
      int x=a[i];
      double y=double(c)/x;
      auto itr=upper_bound(all(b),y);
      bunsi+=b.end()-itr;
      //cout<<b.end()-itr<<endl;
   }
   double ans=double(bunsi)/bunbo;
   cout<<setprecision(10)<<ans<<endl;

   
   
return 0;
}
0