Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

Comments
On Dijkstra.LCM problem at ECPC 2018, 7 months ago
0

EDIT: I got it. It turns out that in the calculation of g=2, I overcount the pairs that have 4 as a gcd and I count them as having 2 as a gcd... In the ans[4], they are divided by 4 (their gcd), so to remove the overcounting I multiply the ans[4] by 2.

On Dijkstra.LCM problem at ECPC 2018, 7 months ago
0

Why do you need to, if for example g=2, to exclude twice the answer of 4?