Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. ifstream fin("cuburi2.in");
  4. ofstream fout("cuburi2.out");
  5. int n, i, j, k, l, m, c ,d, maxx;
  6. int x, y, z;
  7. int mat[55][55];
  8. int h[55][55];
  9. int v[3025][25];
  10. int main() {
  11. fin >> n >> c >> d;
  12. if (d == 1) {
  13. for (i = 1; i <= c; ++i) {
  14. fin >> x >> y >> z;
  15. mat[x][y] = z;
  16. }
  17. fout << n << ' ' << n << '\n';
  18. for (i = 1; i <= n; ++i) {
  19. for (j = 1; j <= n; ++j) {
  20. fout << mat[i][j] << ' ';
  21. }
  22. fout << '\n';
  23. }
  24. }
  25. else if (d == 2) {
  26. for (i = 1; i <= c; ++i) {
  27. fin >> x >> y >> z;
  28. h[x][y]++;
  29. if (h[x][y] > maxx) {
  30. maxx = h[x][y];
  31. }
  32. v[(x - 1) * n + y][h[x][y]] = z;
  33. }
  34. for (i = 1; i <= n; ++i) {
  35. maxx = 0;
  36. for (j = n; j >= 1; ++j) {
  37.  
  38. }
  39.  
  40. fout.close();
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement