| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 156765 | 赵奕杰 | 矩阵右移动 | C++ | Wrong Answer | 1 MS | 292 KB | 421 | 2026-07-10 14:16:10 |
#include<bits/stdc++.h> using namespace std; long long a[1005][1005],b[1005][1005]; int main(){ int n,m; cin>>m>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cin>>a[i][j]; } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ b[i][(j+m)%n+1]=a[i][j]; } } for(int i=1;i<=n;i++){ for(int j=1;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-----
1 2 3 4 5 6 7 8 9