QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#46761#1266. Visual CubeWu_RenAC ✓5ms3712kbC++764b2022-09-01 15:18:282022-09-01 15:18:28

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-09-01 15:18:28]
  • 评测
  • 测评结果:AC
  • 用时:5ms
  • 内存:3712kb
  • [2022-09-01 15:18:28]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int n,m,a,b,c;
char s[110][110];
void sol(){
	cin>>b>>c>>a;
	n=1+2*(a+c),m=1+2*(b+c);
	for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) s[i][j]='.';
	for(int i=0;i<=a;i++) for(int j=0;j<=b;j++) s[2*i+1][2*j+1]='+',s[2*i][2*j+1]='|',s[2*i+1][2*j]='-';
	for(int j=1;j<=c;j++){
		for(int i=1;i<=a;i++) s[1+2*(i+j)][1+2*(b+j)]='+',s[2*(i+j)][1+2*(b+j)]='|',s[2*(i+j)][2*(b+j)]='/';
		s[1+2*j][1+2*(b+j)]='+',s[2*j][2*(b+j)]='/';
		for(int i=1;i<=b;i++) s[1+2*(a+j)][1+2*(i+j)]='+',s[1+2*(a+j)][2*(i+j)]='-',s[2*(a+j)][2*(i+j)]='/';
		s[1+2*(a+j)][1+2*j]='+',s[2*(a+j)][2*j]='/';
	}
	for(int i=n;i>=1;i--,cout<<"\n") for(int j=1;j<=m;j++) cout<<s[i][j];
}
int main(){
	int T;
	cin>>T;
	while(T--) sol();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
1 1 1
6 2 4

output:

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

result:

ok 18 lines

Test #2:

score: 0
Accepted
time: 5ms
memory: 3712kb

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