結果

問題 No.1280 Beyond C
ユーザー snrnsidy
提出日時 2021-12-03 03:59:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 719 bytes
コンパイル時間 2,256 ms
コンパイル使用メモリ 199,272 KB
最終ジャッジ日時 2025-01-26 03:06:32
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
 
using namespace std;


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    long long int n,m,c,t;
    vector <long long int> a,b;

    cin >> n >> m >> c;

    for(int i=0;i<n;i++)
    {
        cin >> t;
        a.push_back(t);
    }

    for(int i=0;i<m;i++)
    {
        cin >> t;
        b.push_back(t);
    }

    sort(b.begin(),b.end());

    long long int res = 0;

    for(int i=0;i<n;i++)
    {
        long long int val = c/a[i];
        int idx = upper_bound(b.begin(),b.end(),val) - b.begin();
        res += (m - idx);
    }

    long double p = res;
    p/=n;
    p/=m;

    cout << fixed;
    cout.precision(16);

    cout << p << '\n';
    
    return 0;
}
0