結果

問題 No.1280 Beyond C
ユーザー milanis48663220
提出日時 2020-11-06 21:30:00
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 728 bytes
コンパイル時間 1,010 ms
コンパイル使用メモリ 85,828 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-22 12:14:41
合計ジャッジ時間 2,118 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long ll;

ll n, m, c;
ll a[100000], b[100000];

void input(){
    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);
    sort(b, b+m);
}

void solve(){
    ll total = n*m;
    ll cnt = 0;
    for(int i = 0; i < n; i++){
        ll x = c/a[i]+1;
        auto p = lower_bound(b, b+m, x);
        cnt += (b+m)-p;
    }
    cout << (double)cnt/(double)total << endl;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    input();
    solve();
}
0