F is totally shit. the O(nv^2) sol is naive and should't appear at this pos actually. if u see the rankings u can find a lot of sols using very complicated algorithms (and some get TLE).
if u swap D and F I bet there will be much more solves.
(P.S Me myself wrote a sol using DP and FWT in contest, which is O(nV*log^3V). although it passed i'm so sad.)
F is totally shit. the O(nv^2) sol is naive and should't appear at this pos actually. if u see the rankings u can find a lot of sols using very complicated algorithms (and some get TLE).
if u swap D and F I bet there will be much more solves.
(P.S Me myself wrote a sol using DP and FWT in contest, which is O(nV*log^3V). although it passed i'm so sad.)