Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for ( int i = 2; i < n + 1; ++i) {
- if ( i == d + 1) {
- ++i;
- }
- if (pow[i] < k && l[par[i]] < min (par[i] - 1, d + 1 - par[i])) {
- ++l[par[i]];
- ll g = k - pow[i];
- for ( int j = 0; j < g; ++j) {
- if ( count < n - d - 1) {
- ++count;
- graph[i].push_back(d + 1 + count);
- ++pow[i];
- ++pow[d + 1 + count];
- if ( i < d + 1) {
- par[d + 1 + count] = i;
- }
- else {
- par[d + 1 + count] = par[i];
- }
- }
- else {
- break;
- }
- }
- }
- if (count == n - d - 1) {
- any = true;
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement