-
个人简介
此号已废。
该用户太懒,这里啥也没写 (´・ω・`)
#include <bits/stdc++.h> #define ll long long #define il inline #define ld long double #define IOS ios::sync_with_stdio(false), cin.tie(0) #define rep(i, a, b) for (int i = (a); i <= (b); i++) #define dep(i, a, b) for (int i = (a); i >= (b); i--) using namespace std; const int N = 100 + 5; int n; int k[105]; vector<int> a[105]; unordered_map<int, int> t[105]; signed main () { IOS; cin >> n; rep(i, 1, n) { cin >> k[i]; rep(j, 1, k[i]) { int x; cin >> x; if (!t[i].count (x)) a[i].push_back(x); t[i][x]++; } } ld ans = 0; rep(i, 1, n) { rep(j, i + 1, n) { ld sum = 0; for (auto v : a[i]) { if (t[j].count (v)) sum += (ld)t[i][v] * (ld)t[j][v]; } sum /= ((ld)k[i] * (ld)k[j]); ans = max(ans, sum); } } cout << fixed << setprecision(10) << ans << endl; return 0; }
-
通过的题目
-
最近活动
This person is lazy and didn't join any contests or homework. -
最近编写的题解
题目标签
- 客观题
- 1