結果

問題 No.1280 Beyond C
ユーザー ytftytft
提出日時 2021-05-18 04:56:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 787 bytes
コンパイル時間 5,334 ms
コンパイル使用メモリ 346,924 KB
実行使用メモリ 14,016 KB
最終ジャッジ日時 2024-04-16 19:14:04
合計ジャッジ時間 9,353 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,912 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 3 ms
6,940 KB
testcase_03 AC 3 ms
6,940 KB
testcase_04 AC 3 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 3 ms
6,940 KB
testcase_08 AC 3 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 3 ms
6,944 KB
testcase_11 AC 52 ms
6,944 KB
testcase_12 AC 3 ms
6,940 KB
testcase_13 AC 19 ms
6,944 KB
testcase_14 AC 40 ms
6,944 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
typedef boost::multiprecision::cpp_int mp;


int main(){
    int N,M;
    long long C;
    cin>>N>>M>>C;
    vector<long long> A(N),B(M);
    for(int i=0;i<N;++i){
        cin>>A[i];
    }
    for(int i=0;i<M;++i){
        cin>>B[i];
    }
    sort(A.begin(),A.end());
    sort(B.begin(),B.end());
    long long ans=0;
    for(int i=0;i<N;i++){
        cerr<<A[i]<<endl;
        int l=-1,r=M;
        while(r-l>1){
            cerr<<l<<' '<<r<<endl;
            int m=(l+r)/2;
            cerr<<B[m]<<endl;
            if(C<B[m]*A[i]){
                r=m;
            }else{
                l=m;
            }
        }
        ans+=M-r;
    }
    cout<<((double)ans/(double)N/(double)M)<<endl;
}
0