結果
| 問題 |
No.1280 Beyond C
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-07 17:34:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 859 bytes |
| コンパイル時間 | 882 ms |
| コンパイル使用メモリ | 88,292 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-22 14:38:16 |
| 合計ジャッジ時間 | 2,560 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 14 RE * 2 |
ソースコード
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define MOD 1000000007
int main() {
int n, m;
cin >> n >> m;
ll c;
cin >> c;
vector<ll> a(n), b(m + 2);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
for (int i = 1; i <= m; ++i) {
cin >> b[i];
}
b[0] = 0, b[n + 1] = 1e18 + 1;
ll win = 0;
sort(b.begin(), b.end());
for (int i = 0; i < n; ++i) {
int ok = n + 1, ng = 0;
while (1 < abs(ok - ng)) {
int mid = (ok + ng) / 2;
if (c < a[i] * b[mid]) {
ok = mid;
} else {
ng = mid;
}
}
win += n - ok + 1;
}
printf("%.15f\n", (double)(win) / (n * m));
return 0;
}