Advertisement
Guest User

Untitled

a guest
May 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. //// n1
  2. for (int j = 1; j <= n1; j++){
  3. C[0][j] = 1;
  4. }
  5. for (int v = 1; v < n1 + 1; v++){
  6. in >> k[v];
  7. for (int j = 0; j < k[v]; j++){
  8. in >> to;
  9. C[v][to] = INT_MAX;
  10. }
  11. }
  12. //// n2
  13. for (int v = n1 + 1, count = 0; v < n1 + 2 * n2 + 1; v += 2, count++){
  14. C[v][v + 1] = c[count];
  15. }
  16. for (int v = n1 + 2, count = 0; v < n1 + 2 * n2 + 1; v += 2, count++) {
  17. in >> k[v];
  18. for (int j = 0; j < k[v]; j++) {
  19. in >> to;
  20. if(to <= n1 + n2)
  21. C[v][to * 2 - (n1 + 1)] = INT_MAX;
  22. else
  23. C[v][to + (n1 + 1)] = INT_MAX;
  24. }
  25. }
  26. //// n3
  27. for (int i = n1 + 2 * n2 + 1; i < N - 1; i++) {
  28. C[i][N-1] = 1;
  29. }
  30. for (int i = 0; i < N; i++) {
  31. for (int j = 0; j < N; j++) {
  32. cout << C[i][j] << " ";
  33. }
  34. cout << endl;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement