Add a lot more problems and a TODO list

This commit is contained in:
2025-10-18 16:54:05 -03:00
parent f82c3630cf
commit f3275cd442
72 changed files with 9550 additions and 17 deletions

View File

@@ -87,29 +87,35 @@ int main()
ll y;
cin >> n >> y;
set<int> divs;
vl fds(n);
cin >> fds;
auto getdivs = [&](ll v) {
for (ll i = 1; i * i <= v; i++) {
if (v % i == 0) {
divs.insert(i);
divs.insert(v / i);
}
vl count(2e5 + 1);
ll limit = 1;
rep(i, n) {
count[fds[i]]++;
rmax(limit, fds[i]);
}
nrep(i, 1, (int)2e5 + 1) {
count[i] += count[i - 1];
}
ll ans = -INT64_MAX >> 1;
nrep(x, 2, (int)2e5 + 1) {
ll now = 0;
for (int i = 1; i <= (int)2e5; i += x) {
int upper = min(i + x - 1, (int)2e5);
int act = (i / x) + 1;
now += (count[upper] - count[i - 1]) * act;
now -= y * max(0LL, (count[upper] - count[i - 1]) - (count[act] - count[act - 1]));
}
};
repv(i, fds) {
getdivs(i);
rmax(ans, now);
}
divs.erase(1);
ll ans = -1e17;
repv(j, divs) {
}
cout << ans << '\n';
}
}