T2
  • 板块学术版
  • 楼主I_KUN
  • 当前回复6
  • 已保存回复6
  • 发布时间2024/9/7 18:29
  • 上次更新2024/9/7 18:55:40
查看原帖
T2
731213
I_KUN楼主2024/9/7 18:29

rt,赛后搞出来的不知道能不能过

顺便问一下什么时候加入题库

#include<bits/stdc++.h>
using namespace std;
bool b[2005][2005];
int main(){
	int n,m,T,k;
	cin>>T;
	while(T--){
		memset(b,0,sizeof(b));
		cin>>n>>m>>k;
		for(int i=1;i<=n&&k;i++)
			for(int j=1;j<=m&&k;j++)
				if(i==j)b[i][j]=1,k--;
		for(int i=1;i<=n;i++){
			for(int j=1;j<=m;j++)
				if(b[i][j])cout<<'S';
				else if(k)cout<<"S",k--;
				else cout<<".";
			cout<<endl;
		}
	}	
	return 0;
}
2024/9/7 18:29
加载中...