結果

問題 No.1280 Beyond C
ユーザー milanis48663220milanis48663220
提出日時 2020-11-06 21:30:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 728 bytes
コンパイル時間 809 ms
コンパイル使用メモリ 85,624 KB
実行使用メモリ 5,132 KB
最終ジャッジ日時 2023-09-29 18:13:43
合計ジャッジ時間 2,333 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,388 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 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 24 ms
4,444 KB
testcase_16 AC 19 ms
4,380 KB
testcase_17 AC 23 ms
4,384 KB
testcase_18 AC 32 ms
5,132 KB
testcase_19 AC 33 ms
5,096 KB
testcase_20 AC 44 ms
5,096 KB
testcase_21 AC 42 ms
5,116 KB
testcase_22 AC 43 ms
5,112 KB
権限があれば一括ダウンロードができます

ソースコード

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