QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#607302 | #1266. Visual Cube | liukejie | RE | 0ms | 0kb | C++14 | 1.9kb | 2024-10-03 14:38:45 | 2024-10-03 14:38:46 |
answer
// liukejie
// 2024-10-03 08:49:01
#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for(int i = l; i <= r; ++ i)
#define per(i, r, l) for(int i = r; i >= l; -- i)
const int N = 1000;
int Q, a, b, c;
char s[N][N];
int t[N];
main()
{
freopen("draw.in", "r", stdin);
freopen("draw.out", "w", stdout);
scanf("%d", &Q);
for(; Q; -- Q)
{
scanf("%d%d%d", &a, &b, &c);
memset(s, '0', sizeof s);
rep(i, 1, b * 2)
{
rep(j, 1, b * 2 - i + 1) s[i][j] = '.';
t[i] = b * 2 - i + 1;
if(i & 1)
{
int id = 0;
rep(j, t[i] + 1, t[i] + 2 * a + 1)
{
++ id;
if(id & 1) s[i][j] = '+';
else s[i][j] = '-';
}
}
else
{
int id = 0;
rep(j, t[i] + 1, t[i] + 2 * a + 1)
{
++ id;
if(id & 1) s[i][j] = '/';
else s[i][j] = '.';
}
}
t[i] += 2 * a + 1;
}
int id = 0;
rep(i, b * 2 + 1, b * 2 + 1 + 2 * c)
{
++ id;
if(id & 1)
{
rep(j, 1, 2 * a + 1)
{
if(j & 1) s[i][j] = '+';
else s[i][j] = '-';
}
}
else
{
rep(j, 1, 2 * a + 1)
{
if(j & 1) s[i][j] = '|';
else s[i][j] = '.';
}
}
t[i] = 2 * a + 1;
}
rep(i, 1, b * 2 + 1 + 2 * c)
{
if(i & 1)
{
int id = 0;
rep(j, t[i] + 1, b * 2 + 1 + 2 * a)
{
++ id;
if(id & 1) s[i][j] = '.';
else s[i][j] = '+';
}
}
else
{
int id = 0;
if(s[i][t[i]] == '|') ++ id;
rep(j, t[i] + 1, b * 2 + 1 + 2 * a)
{
++ id;
if(id & 1) s[i][j] = '|';
else s[i][j] = '/';
}
}
t[i] = b * 2 + 1 + 2 * a;
}
id = 2 * b;
per(i, b * 2 + 1 + 2 * c, 2 * c + 1)
{
per(j, t[i], t[i] - id + 1) s[i][j] = '.';
-- id;
}
rep(i, 1, b * 2 + 1 + 2 * c)
{
rep(j, 1, t[i]) printf("%c", s[i][j]);
puts("");
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Dangerous Syscalls
input:
2 1 1 1 6 2 4