HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Forums > Discussion of problems > topic:


Problem "51132 - Problem Solving Competition"

There is a contest!

В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания.

imesecanMay.30.2017 at 01:14:46 PM
0--- Test 1 ---
12 4
Dervish 8
Dervish 13
Arsen 15
Stela 19
Arsen 7
Jan 4
Flokrida 19
Bai 18
Arsen 6
Dervish 15
Marius 12
Flokrida 7
5
Bai Arsen
Flokrida Bai
Marius Flokrida
Flokrida Marius
Bai Dervish

--- Pattern ---
24.0

imesecanJune.10.2017 at 08:08:34 AM
1You can send the number of questions solved by each student as another parameter to Union Find.
classes = new UF(stId+1, numQuestionsArray);
Then, similar to sizes array, you need to calculate sum of the questions solved by the group.
sizes[b] += sizes[a];
nqs[b] += nqs[a]; // number of questions solved


www.contester.ru