Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
39654 爱睡觉的猫(cat)(2024岳阳市赛小学组) C++ 运行超时 1000 MS 280 KB 452 2024-05-05 09:04:18

Tests(0/12):


#include <bits/stdc++.h> using namespace std; int n,s[105][105],x,y,t; int main(){ cin>>n; x=1; y=n; t=n*n; s[x][y]=t; t--; while(t){ while(x+1<=n&&s[x+1][y]==0){ x++; s[x][y]=t; t--; } while(y+1<=n&&s[x+1][y]==0){ y++; s[x][y]=t; t--; } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cout<<s[i][j]<<" "; } cout<<endl; } return 0; }


测评信息: