結果

問題 No.1280 Beyond C
ユーザー ゆにぽけゆにぽけ
提出日時 2023-10-20 01:14:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 873 bytes
コンパイル時間 1,401 ms
コンパイル使用メモリ 129,460 KB
実行使用メモリ 4,648 KB
最終ジャッジ日時 2023-10-20 01:15:05
合計ジャッジ時間 2,591 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 23 ms
4,348 KB
testcase_16 AC 19 ms
4,348 KB
testcase_17 AC 22 ms
4,348 KB
testcase_18 AC 30 ms
4,648 KB
testcase_19 AC 30 ms
4,648 KB
testcase_20 AC 41 ms
4,648 KB
testcase_21 AC 42 ms
4,648 KB
testcase_22 AC 41 ms
4,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cassert>
#include<cmath>
#include<ctime>
#include<iomanip>
#include<numeric>
#include<stack>
#include<queue>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<bitset>
#include<random>
using namespace std;
int N,M,A[1 << 17],B[1 << 17];
long long C;
void solve()
{
	cin >> N >> M >> C;
	for(int i = 0;i < N;i++) cin >> A[i];
	for(int i = 0;i < M;i++) cin >> B[i];
	sort(A,A+N,greater<int>());
	sort(B,B+M);
	int bi = 0;
	long long num = 0;
	for(int i = 0;i < N;i++)
	{
		while(bi < M && (long long)A[i]*B[bi] <= C) bi++;
		num += M-bi;
	}
	long long den = (long long)N*M;
	cout << fixed << setprecision(16);
	cout << (double)num/den << endl;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int tt = 1;
	//cin >> tt;
	while(tt--) solve();
}
0