結果

問題 No.1280 Beyond C
ユーザー 👑 platinumplatinum
提出日時 2020-11-03 19:39:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 914 bytes
コンパイル時間 678 ms
コンパイル使用メモリ 81,076 KB
実行使用メモリ 4,700 KB
最終ジャッジ日時 2023-09-29 14:59:13
合計ジャッジ時間 3,929 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 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,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 92 ms
4,604 KB
testcase_19 AC 91 ms
4,620 KB
testcase_20 AC 93 ms
4,616 KB
testcase_21 AC 93 ms
4,640 KB
testcase_22 AC 93 ms
4,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <cassert>
#include <algorithm>
#define rep(i,n) for(int i=0; i<(int)(n); i++)

using namespace std;
using LL = long long;
const int Max_N = 1e5;
const LL Max_C = 1e18;
const LL Max_A = 1e9;

int main(){
  LL N, M, C;
  cin >> N >> M >> C;
  assert(1 <= N and N <= Max_N);
  assert(1 <= M and M <= Max_N);
  assert(1 <= C and C <= Max_C);
  vector<LL> a(N), b(M);
  rep(i,N) cin >> a[i];
  rep(i,N) assert(1 <= a[i] and a[i] <= Max_A);
  rep(i,M) cin >> b[i];
  rep(i,M) assert(1 <= b[i] and b[i] <= Max_A);
  sort(b.begin(),b.end());
  double ans = 0;
  rep(i,N){
  	int left = -1, right = M;
  	int mid = (left + right) / 2;
  	while(right - left > 1){
  		if(a[i] * b[mid] > C) right = mid;
  		else left = mid;
  		mid = (left + right) / 2;
  	}
  	ans += M - right;
  }
  ans /= N * M;
  cout << setprecision(15) << ans << endl;

  return 0;
}
0