| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 156776 | 赵奕杰 | 蛇形矩阵 | C++ | Presentation Error | 1 MS | 300 KB | 425 | 2026-07-10 15:03:44 |
#include<bits/stdc++.h> using namespace std; long long a[1005][1005]; int main(){ int n,k=1; cin>>n; for(int i=1;i<=n;i++){ if(i%2==1){ for(int j=1;j<=n;j++){ a[j][i]=k; k++; } }else{ for(int j=n;j>=1;j--){ a[j][i]=k; k++; } } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cout<<a[i][j]<<" "; } cout<<endl; } return 0; }