#37389: C++詳解


terrytseng98@gmail.com (曾宥誠)

學校 : 不指定學校
編號 : 239893
來源 : [111.249.174.157]
最後登入時間 :
2025-09-27 11:34:34

#include <bits/stdc++.h>
using namespace std;

char ans[25][25];

int main(){


    ios_base::sync_with_stdio(0);     //加速cin
    cin.tie(0);                                   //加速cin

    int k, q, r;
    cin >> k >> q >> r;
    cin >> ans[0];

    for(int i = 0; i < q; i++){
        for(int j = 0; j < k; j++){
            int x; cin >> x;
            ans[i+1][x-1] = ans[i][j];
        }
    }

    for(int i = 0; i < r; i++){
        for(int j = 1; j <= q; j++){
            cout << ans[j][i];
        }
        cout << '\n';
    }

    return 0;
}