今日Div3-T2求调
查看原帖
今日Div3-T2求调
754040
yeqiwei楼主2024/9/7 21:39

rt,代码如下:

#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
char map[2005][2005];
int t;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>t;
	while(t--)
	{
		int n,m,k;
		cin>>n>>m>>k;
		for(int i=0;i<n;++i)
			memset(map[i],'.',m);
		int mins=min(n,m);
		int lastx=0,lasty=0;
		for(int i=0;i<k;++i)
		{
			if(i<mins)
				map[i][i]='S';
			else
			{
				++lasty;
				if(lasty==m)
					lasty=0,++lastx;
				if(lastx==lasty)
					++lasty;
				map[lastx][lasty]='S';
			}
		}
		for(int i=0;i<n;++i)
		{
			for(int j=0;j<m;++j)
				cout<<map[i][j];
			cout<<"\n";
		}
	}
}

WA on #9~#16 & #19~#22 (即Sub3 & Sub4 和 Sub5的后四个点),错误信息如下:

Wrong Answer.wrong answer The total number of stones does not meet the requirements (read 36 stones, expected 48)

求调,玄关

2024/9/7 21:39
加载中...