Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
156766 邓弘锐 矩阵右移动 C++ Wrong Answer 1 MS 292 KB 397 2026-07-10 14:16:19

Tests(0/2):


Code:

#include<bits/stdc++.h> using namespace std; long long a[1008][1008],b[1008][1008]; 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]; cout<<b[i][j]<<" "; } cout<<endl; } return 0; }


Run Info:

------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