QOJ.ac

QOJ

IDSubmission IDProblemHackerOwnerResultSubmit timeJudge time
#388#47560#21670. 【NOIP Round #1】斜二等轴测图SixNukesyyyyxhFailed.2023-09-29 17:16:552023-09-29 17:16:55

Details

Extra Test:

Invalid Input

input:

114514
dfgrbdkjr
fdbg

output:


result:

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

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#47560#21670. 【NOIP Round #1】斜二等轴测图yyyyxh#100 ✓1ms1832kbC++1.3kb2022-09-10 14:40:592022-10-27 22:37:06

answer

#include <cstdio>
using namespace std;
int read(){
	char c=getchar();int x=0;
	while(c<48||c>57) c=getchar();
	do x=(x<<1)+(x<<3)+(c^48),c=getchar();
	while(c>=48&&c<=57);
	return x;
}
char s[203][203];
void dot1(int x,int y){
	s[x][y]='+';
	s[x][y+1]='-';
	s[x-1][y]='|';
}
void dot2(int x,int y){
	s[x][y]='+';
	s[x-1][y]='|';
	s[x-1][y+1]='/';
}
void dot3(int x,int y){
	s[x][y]='+';
	s[x][y+1]='-';
	s[x-1][y+1]='/';
}
void dot4(int x,int y){
	s[x][y]='+';
	s[x][y+1]='-';
}
void dot5(int x,int y){
	s[x][y]='+';
	s[x-1][y+1]='/';
}
void dot6(int x,int y){
	s[x][y]='+';
	s[x-1][y]='|';
}
int main(){
	int testcase=read();
	while(testcase--){
		int a=read(),b=read(),c=read();
		int n=(b+c)<<1|1,m=(a+b)<<1|1;
		for(int i=1;i<=n;++i)
			for(int j=1;j<=m;++j)
				s[i][j]='.';
		for(int i=0;i<c;++i){
			for(int j=0;j<a;++j)
				dot1(n-(i<<1),j<<1|1);
			for(int j=0;j<b;++j)
				dot2(n-((i+j)<<1),(a+j)<<1|1);
		}
		for(int i=0;i<b;++i)
			for(int j=0;j<a;++j)
				dot3(n-((c+i)<<1),(i+j)<<1|1);
		s[1][m]='+';
		int x,y;
		x=1;y=m;
		for(int i=0;i<a;++i) dot4(x,y-=2);
		x=1;y=m;
		for(int i=0;i<b;++i) dot5(x+=2,y-=2);
		x=1;y=m;
		for(int i=0;i<c;++i) dot6(x+=2,y);
		for(int i=1;i<=n;++i){
			for(int j=1;j<=m;++j)
				putchar(s[i][j]);
			putchar('\n');
		}
	}
	return 0;	
}