Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
125702 | 田子熙 | 矩阵右移动 | C++ | Wrong Answer | 1 MS | 280 KB | 415 | 2025-07-15 11:52:50 |
#include<bits/stdc++.h> using namespace std; long long a[15][15]; long long b[15][15]; int main(){ long long m,n; cin>>m>>n; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin>>a[i][j]; } } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ int k=(j+m)%n; b[i][k]=a[i][j]; } } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cout<<b[i][j]; } cout<<endl; } return 0; }
------Input------
2 3 1 2 3 4 5 6 7 8 9
------Answer-----
2 3 1 5 6 4 8 9 7
------Your output-----
231 564 897