結果
問題 | No.1280 Beyond C |
ユーザー |
![]() |
提出日時 | 2020-11-06 22:12:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 739 bytes |
コンパイル時間 | 1,826 ms |
コンパイル使用メモリ | 172,420 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-22 12:57:37 |
合計ジャッジ時間 | 3,546 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 1 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) #define PI acos(-1) #define all(v) v.begin(),v.end() typedef long long ll; ll gcd(ll x,ll y){ if(y==0) return x; else return gcd(y,x%y); } ll lcm(ll x,ll y){ return x/gcd(x,y)*y; } int main(){ ll n,m,c; cin>>n>>m>>c; vector<ll> a(n); vector<ll> b(m); rep(i,n){ cin>>a[i]; } rep(i,m){ cin>>b[i]; } ll bunbo=n*m; ll bunsi=0; sort(all(b)); rep(i,n){ ll x=a[i]; double y=double(c)/x; auto itr=upper_bound(all(b),y); bunsi+=b.end()-itr; //cout<<b.end()-itr<<endl; } double ans=double(bunsi)/bunbo; cout<<setprecision(10)<<ans<<endl; return 0; }