QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#607837 | #1266. Visual Cube | hysbzdkf | AC ✓ | 0ms | 3568kb | C++14 | 1.4kb | 2024-10-03 16:40:35 | 2024-10-03 16:40:36 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
int T,a,b,c;
char ans[100][100];
signed main(){
// freopen("draw.in","r",stdin);
// freopen("draw.out","w",stdout);
cin>>T;
while(T--){
cin>>a>>b>>c;
for(int i=1;i<=1+2*(c+b);i++)
for(int j=1;j<=1+2*(a+b);j++)
ans[i][j]='0';
//in
for(int i=1;i<=1+2*(b+c);i+=2){
int st=max(1ll,2*b-i+2);
int ed=1+2*(a+b)-max(0ll,2*b-(1+2*(b+c)-i));
for(int j=st;j<=ed;j+=2)
ans[i][j]='+';
}
//add '+'
for(int i=2*b+2;i<=2*(c+b)+1;i+=2)
for(int j=1;j<=2*(a+1);j+=2)
ans[i][j]='|';
for(int j=1+2*(a+b);j>=1+2*(a+b)-2*b+2;j-=2)
for(int i=1+2*(a+b)-j+2;i<=1+2*(a+b)-j+2+c*2-1;i+=2)
ans[i][j]='|';
//add '|'
for(int i=2;i<=2*b;i+=2)
for(int j=2*b-i+2;j<=2*b-i+(a+1)*2;j+=2)
ans[i][j]='/';
for(int j=1+2*(a+b);j>=1+2*(a+b)-2*b+2;j-=2)
for(int i=1+2*(a+b)-j+2;i<=1+2*(a+b)-j+2+c*2-1;i+=2)
ans[i+2][j-1]='/';
//add '/'
for(int i=1;i<=b*2-1;i+=2)
for(int j=2*b-i+3;j<=2*b-i+3+(a-1)*2;j+=2)
ans[i][j]='-';
for(int i=2*b+1;i<=1+2*(c+b);i+=2)
for(int j=2;j<=2*a+1;j+=2)
ans[i][j]='-';
//add '-'
for(int i=1;i<=1+2*(c+b);i++){
for(int j=1;j<=1+2*(a+b);j++){
if(ans[i][j]=='0')
cout<<".";
else
cout<<ans[i][j];
}
cout<<endl;
}
//out
}
return 0;
}
/*
1
1 3 3
2
1 1 1
6 2 4
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3568kb
input:
2 1 1 1 6 2 4
output:
..+-+ ././| +-+.+ |.|/. +-+.. ....+-+-+-+-+-+-+ .../././././././| ..+-+-+-+-+-+-+.+ ./././././././|/| +-+-+-+-+-+-+.+.+ |.|.|.|.|.|.|/|/| +-+-+-+-+-+-+.+.+ |.|.|.|.|.|.|/|/| +-+-+-+-+-+-+.+.+ |.|.|.|.|.|.|/|/. +-+-+-+-+-+-+.+.. |.|.|.|.|.|.|/... +-+-+-+-+-+-+....
result:
ok 18 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3552kb
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