結果

問題 No.1280 Beyond C
ユーザー DaYuanChiDaYuanChi
提出日時 2021-01-31 17:03:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 666 bytes
コンパイル時間 1,638 ms
コンパイル使用メモリ 169,716 KB
実行使用メモリ 4,696 KB
最終ジャッジ日時 2023-09-11 11:09:18
合計ジャッジ時間 4,376 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 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 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 50 ms
4,380 KB
testcase_16 AC 42 ms
4,376 KB
testcase_17 AC 50 ms
4,376 KB
testcase_18 AC 95 ms
4,696 KB
testcase_19 AC 91 ms
4,532 KB
testcase_20 AC 95 ms
4,696 KB
testcase_21 AC 93 ms
4,628 KB
testcase_22 AC 94 ms
4,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n)for(int i=0,i<(n);++i)
using namespace std;
using ll = long long;

int main(){
  int n, m;
  cin >> n >> m;
  ll c; cin >> c;
  vector<ll> a(n), b(m+1);
  for(int i = 0; i < n; i++) cin >> a[i];
  for(int i = 0; i < m; i++) cin >> b[i];
  b[m] = 1e9;
  sort(b.begin(), b.end());
  ll cnt = 0;
  for(int i = 0; i < n; i++){
    ll num = c/a[i];
    int l = 0; int r = m;
    while(r-l>1){
      int mid = (l+r)/2;
      if(b[mid]<=num) l = mid;
      else r = mid;
    }
    if(b[0]>num) cnt += m;
    else cnt += m - r;
  }
  double ans = 0;
  ans = cnt/(1.0*m*n);
  printf("%.10f\n",ans);
  return 0;
}
  
    
    
    
  
0