結果

問題 No.1280 Beyond C
ユーザー 👑 platinumplatinum
提出日時 2020-05-18 19:01:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 914 bytes
コンパイル時間 2,775 ms
コンパイル使用メモリ 80,416 KB
実行使用メモリ 4,704 KB
最終ジャッジ日時 2023-08-19 13:07:02
合計ジャッジ時間 3,493 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 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,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,384 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,380 KB
testcase_18 AC 91 ms
4,584 KB
testcase_19 AC 91 ms
4,532 KB
testcase_20 AC 92 ms
4,588 KB
testcase_21 AC 92 ms
4,704 KB
testcase_22 AC 94 ms
4,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

using namespace std;
using LL = long long;
const int Max_Num=1e5;
const LL Max_C=1e18;
const int Max_AB=1e9;

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

	return 0;
}
0