Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. for ( int i = 2; i < n + 1; ++i) {
  2. if ( i == d + 1) {
  3. ++i;
  4. }
  5. if (pow[i] < k && l[par[i]] < min (par[i] - 1, d + 1 - par[i])) {
  6. ++l[par[i]];
  7. ll g = k - pow[i];
  8. for ( int j = 0; j < g; ++j) {
  9. if ( count < n - d - 1) {
  10. ++count;
  11. graph[i].push_back(d + 1 + count);
  12. ++pow[i];
  13. ++pow[d + 1 + count];
  14. if ( i < d + 1) {
  15. par[d + 1 + count] = i;
  16. }
  17. else {
  18. par[d + 1 + count] = par[i];
  19. }
  20. }
  21. else {
  22. break;
  23. }
  24. }
  25. }
  26. if (count == n - d - 1) {
  27. any = true;
  28. break;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement