結果

問題 No.1280 Beyond C
ユーザー 👑 platinumplatinum
提出日時 2020-05-18 19:01:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 914 bytes
コンパイル時間 889 ms
コンパイル使用メモリ 81,036 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-06 20:11:53
合計ジャッジ時間 2,943 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 46 ms
5,376 KB
testcase_16 AC 38 ms
5,376 KB
testcase_17 AC 44 ms
5,376 KB
testcase_18 AC 85 ms
5,376 KB
testcase_19 AC 88 ms
5,376 KB
testcase_20 AC 85 ms
5,376 KB
testcase_21 AC 84 ms
5,376 KB
testcase_22 AC 86 ms
5,376 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