Codeforces Round #385 (Div. 2), problem: (C) Hongcow Builds A Nation Solution in C/C++
#include <stdio.h> #include <string.h> int c, p, sz, gov; int find_parent(int n) { if (p == n) return n; return p = find_parent(p); } int get_full_size(int n) { return n * (n-1) / 2; } …