結果

問題 No.1280 Beyond C
ユーザー yamakeyamake
提出日時 2020-11-06 22:20:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 882 bytes
コンパイル時間 2,288 ms
コンパイル使用メモリ 86,436 KB
実行使用メモリ 5,512 KB
最終ジャッジ日時 2023-09-29 19:01:04
合計ジャッジ時間 2,604 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 50 ms
4,376 KB
testcase_16 AC 42 ms
4,380 KB
testcase_17 AC 50 ms
4,380 KB
testcase_18 AC 86 ms
5,432 KB
testcase_19 AC 87 ms
5,408 KB
testcase_20 AC 92 ms
5,436 KB
testcase_21 AC 92 ms
5,508 KB
testcase_22 AC 93 ms
5,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>
#include<map>

using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define debug(output) cout<<#output<<"= "<<output<<endl

using P=pair<int,int>;
using lint=long long;
using ll=long long;
const lint inf=1e18+7;
const int MOD=1000000007;
signed main(){
  lint n,m,c;cin>>n>>m>>c;
  vector<lint> a(n),b(m);
  rep(i,n)cin>>a[i];
  rep(i,m)cin>>b[i];
  b.push_back(0);
  lint sm=0;
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  b.push_back(c/a[0]+1+b[m]);
  int cur=m+1;
  rep(i,n){
    while(b[cur]*a[i]>c)--cur;
    sm+=m-cur;
  }
  double res=(double)sm/(double)n/(double)m;
  printf("%.12lf\n",res);
  return 0;
}
0