QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#655968 | #1266. Visual Cube | lzh999 | AC ✓ | 1ms | 3696kb | C++14 | 1.5kb | 2024-10-19 10:34:54 | 2024-10-19 10:34:55 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
long long a,b,c;
char k[100+5][100+5];
void sol()
{
cin>>a>>b>>c;
for(long long i=1;i<=100;i++)
{
for(long long j=1;j<=100;j++) k[i][j]='.';
}
for(long long i=1;i<=b*2+1;i+=2)
{
for(long long j=b*2+2-i;j<=b*2+2-i+(a*2+1)-1;j+=2) k[i][j]='+';
for(long long j=b*2+2-i+1;j<=b*2+2-i+(a*2+1)-1;j+=2) k[i][j]='-';
}
for(long long i=2;i<=b*2+1;i+=2)
{
for(long long j=b*2+2-i;j<=b*2+2-i+(a*2+1)-1;j+=2) k[i][j]='/';
for(long long j=b*2+2-i+1;j<=b*2+2-i+(a*2+1)-1;j+=2) k[i][j]='.';
}
for(long long i=b*2+1;i<=b*2+1+(c*2+1)-1;i+=2)
{
for(long long j=1;j<=2*a+1;j+=2) k[i][j]='+';
for(long long j=2;j<=2*a+1;j+=2) k[i][j]='-';
}
for(long long i=b*2+2;i<=b*2+1+(c*2+1)-1;i+=2)
{
for(long long j=1;j<=2*a+1;j+=2) k[i][j]='|';
for(long long j=2;j<=2*a+1;j+=2) k[i][j]='.';
}
long long cur=b*2+1;
for(long long j=a*2+1;j<=(a*2+1)+(b*2+1)-1;j+=2)
{
for(long long i=cur;i<=cur+(2*c+1)-1;i+=2) k[i][j]='+';
for(long long i=cur+1;i<=cur+(2*c+1)-1;i+=2) k[i][j]='|';
cur-=2;
}
cur=b*2;
for(long long j=a*2+2;j<=(a*2+1)+(b*2+1)-1;j+=2)
{
for(long long i=cur;i<=cur+(2*c+1)-1;i+=2) k[i][j]='/';
for(long long i=cur+1;i<=cur+(2*c+1)-1;i+=2) k[i][j]='.';
cur-=2;
}
for(long long i=1;i<=(2*b+1)+(2*c+1)-1;i++)
{
for(long long j=1;j<=(2*a+1)+(2*b+1)-1;j++) cout<<k[i][j];
cout<<"\n";
}
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long t;
cin>>t;
while(t--)
{
sol();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3696kb
input:
2 1 1 1 6 2 4
output:
..+-+ ././| +-+.+ |.|/. +-+.. ....+-+-+-+-+-+-+ .../././././././| ..+-+-+-+-+-+-+.+ ./././././././|/| +-+-+-+-+-+-+.+.+ |.|.|.|.|.|.|/|/| +-+-+-+-+-+-+.+.+ |.|.|.|.|.|.|/|/| +-+-+-+-+-+-+.+.+ |.|.|.|.|.|.|/|/. +-+-+-+-+-+-+.+.. |.|.|.|.|.|.|/... +-+-+-+-+-+-+....
result:
ok 18 lines
Test #2:
score: 0
Accepted
time: 1ms
memory: 3568kb
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