Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- void dbg_out() { cerr << endl; }
- template<typename Head, typename... Tail>
- void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }
- #define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
- #define rng_init mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
- #define rng_seed(x) mt19937 rng(x)
- #define all(x) (x).begin(), (x).end()
- #define sz(x) (int) (x).size()
- // #define int long long
- const int MXN = 1e5 + 5, INF = 1e9 + 5;
- void solve() {
- int N, M;
- cin >> N >> M;
- int A[N][M];
- for (int i = 0; i < N; i++)
- for (int j = 0; j < M; j++)
- cin >> A[i][j];
- vector<vector<int>> ans;
- for (int j = M - 1; j >= 0; j--) {
- ans.emplace_back();
- for (int i = 0; i < N; i++)
- ans.back().push_back(A[i][j]);
- }
- for (int i = 0; i < N; i++) {
- for (int j = 0; j < M; j++)
- cout << A[i][j] << " ";
- cout << "\n";
- }
- for (int j = 0; j < M * M; j++)
- cout << "-";
- cout << "\n";
- for (const auto &row : ans) {
- for (const auto &x : row) {
- cout << x << " ";
- }
- cout << "\n";
- }
- }
- signed main() {
- ios_base::sync_with_stdio(false);
- cin.tie(nullptr);
- int TC = 1;
- // cin >> TC;
- while (TC--) solve();
- }
Advertisement
Add Comment
Please, Sign In to add comment