QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#55285#1266. Visual CubelgvcAC ✓3ms3764kbC++2.1kb2022-10-12 22:23:072022-10-12 22:23:07

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-12 22:23:07]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3764kb
  • [2022-10-12 22:23:07]
  • 提交

answer

#include <bits/stdc++.h>
//#define int long long
#define pai 3.141592653589793238462643383279502884197169399375105820
#define MOD 1000000007
#define eps 0.00000001
inline int min(int a,int b) {return a<b?a:b;}
inline int max(int a,int b) {return a>b?a:b;}
#define ULL unsigned long long
#define LL long long
#define INF 0x3f3f3f3f
#define INF_LL 0x3f3f3f3f3f3f3f3f
static char buf[1000000],*paa=buf,*pd=buf;
static char buf2[1000000],*pp=buf2;
#define getchar() paa==pd&&(pd=(paa=buf)+fread(buf,1,1000000,stdin),paa==pd)?EOF:*paa++
inline void pc(char ch){
	if(pp-buf2==1000000) fwrite(buf2,1,1000000,stdout),pp=buf2;
	*pp++=ch;
}
inline void pcc(){
	fwrite(buf2,1,pp-buf2,stdout);
	pp=buf2;
}
inline int read(void) {
	int w=1;
	register int x(0);register char c(getchar());
	while(c<'0'||c>'9') {if(c=='-') w=-1;c=getchar();}
	while(c>='0'&&c<='9') x=(x<<1)+(x<<3)+(c^48),c=getchar();
	return w*x;
}
void write(int x) {
	static int sta[20];
	int top=0;
	do {
		sta[top++]=x%10,x/=10;
	} while(x);
	while(top) pc(sta[--top]+48);
}
void we(int x) {
	write(x);
	pc('\n');
}
inline bool cmp_xi(int a,int b) {return a<b;}
inline bool cmp_da(int a,int b) {return a>b;}
int T,a,b,c;
char s[1000][1000];
signed main(void) {
    //freopen("m.in","r",stdin);
	//freopen("m.out","w",stdout);
	T=read();
	while(T--) {
		a=read();b=read();c=read();
		for(int i=1;i<=2*b+2*c+1;i++) {
			for(int j=1;j<=2*a+2*b+1;j++) {
				s[i][j]='.';
			}
			s[i][2*a+2*b+2]=0;
		}
		for(int i=1;i<=2*c+1;i+=2) {
			for(int j=1;j<=2*a+1;j+=2) {
				s[i][j]='+';
				if(j>1) s[i][j-1]='-';
				if(i>1) s[i-1][j]='|';
			}
		} 
		for(int i=1;i<=2*a+1;i+=2) {
			int x=2*c+1,y=i;
			bool ff=0;
			if(i==2*a+1) ff=1; 
			for(int j=1;j<=b;j++) {
				s[x+1][y+1]='/';
				if(!ff) s[x+2][y+3]='-';
				s[x+2][y+2]='+';
				x+=2;y+=2;
			}
		}
		for(int i=1;i<2*c+1;i+=2) {
			int x=i,y=2*a+1;
			bool ff=0;
			for(int j=1;j<=b;j++) {
				s[x+1][y+1]='/';
				if(!ff) s[x+3][y+2]='|';
				s[x+2][y+2]='+';
				x+=2;y+=2;
			}
		}		
		for(int i=2*b+2*c+1;i>=1;i--) printf("%s\n",s[i]+1);
	}
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 3676kb

input:

2
1 1 1
6 2 4

output:

..+-+
././|
+-+.+
|.|/.
+-+..
....+-+-+-+-+-+-+
.../././././././|
..+-+-+-+-+-+-+.+
./././././././|/|
+-+-+-+-+-+-+.+.+
|.|.|.|.|.|.|/|/|
+-+-+-+-+-+-+.+.+
|.|.|.|.|.|.|/|/|
+-+-+-+-+-+-+.+.+
|.|.|.|.|.|.|/|/.
+-+-+-+-+-+-+.+..
|.|.|.|.|.|.|/...
+-+-+-+-+-+-+....

result:

ok 18 lines

Test #2:

score: 0
Accepted
time: 3ms
memory: 3764kb

input:

50
16 19 7
1 8 12
5 15 16
12 9 14
9 2 11
8 11 8
2 1 20
8 16 3
2 7 1
3 17 7
13 13 11
5 9 5
11 10 3
19 4 6
13 17 9
9 17 8
14 3 11
9 4 2
9 6 5
4 9 1
12 8 18
4 7 2
13 3 9
1 13 17
17 11 3
9 2 13
5 7 2
6 18 14
14 14 11
5 12 14
16 7 1
5 19 10
16 9 1
9 8 6
11 7 18
12 20 10
10 16 13
17 12 9
9 9 17
10 2 12
1 ...

output:

......................................+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...................................../././././././././././././././././|
....................................+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.+
.................................../././././././././././././././././|/|
...............

result:

ok 1988 lines