Advertisement
Guest User

Untitled

a guest
Dec 7th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. //pure shit
  2. //maybe not :P
  3. #include <iostream>
  4. #include <climits>
  5. #include <algorithm>
  6. using namespace std;
  7. /*int main() {
  8. setlocale(LC_ALL, "rus");
  9. int n, nc, y;
  10. cin >> nc;
  11. int **ar = new int*[nc*2], *x = new int[nc];
  12. for (int i = 0; i < nc; ++i) {
  13. ar[i] = new int[nc];
  14. for (int j = 0; j < nc; ++j)
  15. cin >> ar[i][j];
  16. }
  17. for (int i = 0; i < nc; ++i) cin >> x[i];
  18. cin >> y;
  19. n = nc;
  20. for (int i = 0; i < n; ++i) {
  21. for (int j = 0; j < nc; ++j) {
  22. if (ar[i][j]%y == 0) {
  23. for (int k = n + 1; k >= i; k--) ar[k] = ar[k - 1];
  24. ar[i] = x;
  25. i++, n++;
  26. break;
  27. }
  28. }
  29. }
  30. for (int i = 0; i < n; ++i) {
  31. for (int j = 0; j < nc; ++j)
  32. cout << ar[i][j] << " ";
  33. cout << "\n";
  34. }
  35. system("pause");
  36. }*/
  37. /*int main() {
  38. setlocale(LC_ALL, "rus");
  39. int n, nc, y;
  40. cin >> nc;
  41. int **ar = new int*[nc];
  42. for (int i = 0; i < nc; ++i) {
  43. ar[i] = new int[nc*2];
  44. for (int j = 0; j < nc; ++j)
  45. cin >> ar[i][j];
  46. }
  47. n = nc;
  48. for (int i = 0; i < n; ++i) {
  49. bool add = 1;
  50. for (int j = 0; j < nc; ++j)
  51. if (ar[j][i] % 2) { add = 0; break; }
  52. if (add) {
  53. for (int k = 0; k < nc; ++k)
  54. for (int j = n; j > i; --j)
  55. ar[k][j] = ar[k][j-1];
  56. for (int k = 0; k < nc; ++k)
  57. ar[k][i+1] = ar[k][i];
  58. i++, n++;
  59. }
  60. }
  61. for (int i = 0; i < nc; ++i) {
  62. for (int j = 0; j < n; ++j)
  63. cout << ar[i][j] << " ";
  64. cout << "\n";
  65. }
  66. system("pause");
  67. }*/
  68. /*int main() {
  69. setlocale(LC_ALL, "rus");
  70. int n, nc, y, mn = INT_MAX;
  71. cin >> nc;
  72. int **ar = new int*[nc];
  73. for (int i = 0; i < nc; ++i) {
  74. ar[i] = new int[nc];
  75. for (int j = 0; j < nc; ++j) {
  76. cin >> ar[i][j];
  77. mn = min(mn, ar[i][j]);
  78. }
  79. }
  80. n = nc;
  81. for (int i = 0; i < n; ++i) {
  82. bool del = 0;
  83. for (int j = 0; j < nc; ++j)
  84. if (ar[i][j] == mn) { del = 1; break; }
  85. if (del) {
  86. for (int j = i; j < n - 1; ++j)
  87. ar[j] = ar[j+1];
  88. n--; i--;
  89. }
  90. }
  91. cout << "Printing\n";
  92. for (int i = 0; i < n; ++i) {
  93. for (int j = 0; j < nc; ++j)
  94. cout << ar[i][j] << " ";
  95. cout << "\n";
  96. }
  97. system("pause");
  98. }*/
  99. /*int main() {
  100. setlocale(LC_ALL, "rus");
  101. int n, nc, y, mx = INT_MIN;
  102. cin >> nc;
  103. int **ar = new int*[nc];
  104. for (int i = 0; i < nc; ++i) {
  105. ar[i] = new int[nc];
  106. for (int j = 0; j < nc; ++j) {
  107. cin >> ar[i][j];
  108. mx = max(mx, ar[i][j]);
  109. }
  110. }
  111. n = nc;
  112. for (int i = 0; i < n; ++i) {
  113. bool del = 0;
  114. for (int j = 0; j < nc; ++j)
  115. if (ar[j][i] == mx) { del = 1; break; }
  116. if (del) {
  117. for (int k = 0; k < nc; ++k)
  118. for (int j = i; j < n - 1; ++j)
  119. ar[k][j] = ar[k][j + 1];
  120. n--; i--;
  121. }
  122. }
  123. cout << "Printing\n";
  124. for (int i = 0; i < nc; ++i) {
  125. for (int j = 0; j < n; ++j)
  126. cout << ar[i][j] << " ";
  127. cout << "\n";
  128. }
  129. system("pause");
  130. }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement