QOJ.ac

QOJ

IDSubmission IDProblemHackerOwnerResultSubmit timeJudge time
#389#182653#21670. 【NOIP Round #1】斜二等轴测图SixNukesliuhangxinFailed.2023-09-29 21:55:422023-09-29 21:55:43

Details

Extra Test:

Invalid Input

input:

114514
1919810

output:


result:

FAIL Integer parameter [name=T] equals to 114514, violates the range [1, 50] (stdin, line 1)

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#182653#21670. 【NOIP Round #1】斜二等轴测图liuhangxin100 ✓1ms3724kbC++14921b2023-09-18 12:11:292023-09-18 12:11:30

answer

#include<bits/stdc++.h>
using namespace std;
const int N=85;
int t,a,b,c,n,m;
char s[N][N];
int main()
{
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%d%d",&a,&b,&c);
		n=2*(b+c)+1,m=2*(a+b)+1;
		for(int i=1;i<=n;i++)
			for(int j=1;j<=m;j++)
				s[i][j]='.';
		for(int i=2*b+1;i<=n;i+=2)
			for(int j=2;j<=2*a+1;j+=2)
			s[i][j]='-';
		for(int i=1;i<=2*b;i+=2)
			for(int j=2*b+3-i,k=1;k<=a;j+=2,k++)
			s[i][j]='-';
		for(int i=2*b+2;i<=n;i+=2)
			for(int j=1;j<=2*a+1;j+=2)
			s[i][j]='|';
		for(int j=m;j>m-2*b;j-=2)
			for(int i=m-j+2,k=1;k<=c;i+=2,k++)
			s[i][j]='|';
		for(int i=2*b+1;i<=n;i+=2)
			for(int j=1;j<=2*a+1;j+=2)
				s[i][j]='+';
		for(int i=n-2;i>=1;i--)
			for(int j=3;j<=m;j++)
				if(s[i][j]=='.'&&s[i+2][j-2]=='+')
				s[i][j]='+',s[i+1][j-1]='/';
		for(int i=1;i<=n;i++)
		{
			for(int j=1;j<=m;j++)
				putchar(s[i][j]);
			puts("");
		}
	}
	return 0;
}