結果
| 問題 |
No.1280 Beyond C
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-06 21:37:44 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 2,000 ms |
| コード長 | 443 bytes |
| コンパイル時間 | 1,864 ms |
| コンパイル使用メモリ | 198,348 KB |
| 最終ジャッジ日時 | 2025-01-15 20:22:45 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | lint c; scanf("%d%d%lld",&n,&m,&c);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
main.cpp:12:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | rep(i,n) scanf("%lld",&a[i]);
| ~~~~~^~~~~~~~~~~~~~
main.cpp:13:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | rep(j,m) scanf("%lld",&b[j]);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using lint=long long;
int main(){
int n,m;
lint c; scanf("%d%d%lld",&n,&m,&c);
vector<lint> a(n),b(m);
rep(i,n) scanf("%lld",&a[i]);
rep(j,m) scanf("%lld",&b[j]);
sort(a.begin(),a.end());
sort(b.begin(),b.end());
lint res=0;
rep(i,n){
res+=b.end()-lower_bound(b.begin(),b.end(),c/a[i]+1);
}
printf("%.9f\n",double(res)/n/m);
return 0;
}