QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#326377 | #1266. Visual Cube | iee | AC ✓ | 1ms | 3640kb | C++23 | 984b | 2024-02-12 23:12:10 | 2024-02-12 23:12:11 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const char block[10][10] = {
"##+-+",
"#/./|",
"+-+.+",
"|.|/#",
"+-+##"
};
char ans[99][99];
void go(int x, int y) {
for (int i = x - 4; i <= x; ++i)
for (int j = y; j <= y + 4; ++j) {
int m = i - (x - 4), n = j - y;
if (block[m][n] != '#')
ans[i][j] = block[m][n];
}
}
void solve() {
int a, b, c;
cin >> a >> b >> c;
int row = 1 + 2 * (b + c), col = 1 + 2 * (a + b);
memset(ans, '.', sizeof ans);
for (int i = 1; i <= b; ++i)
for (int j = 1; j <= a; ++j) {
int x = row - 2 * (b - i), y = 2 * (b - i) + 2 * (j - 1) + 1;
for (int k = 1; k <= c; ++k)
go(x, y), x -= 2;
}
for (int i = 1; i <= row; ++i, cout << '\n')
for (int j = 1; j <= col; ++j)
cout << ans[i][j];
}
int main() {
//freopen("draw3.in", "r", stdin), freopen("draw3.out", "w", stdout);
int T;
cin >> T;
while (T--) solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3640kb
input:
2 1 1 1 6 2 4
output:
..+-+ ././| +-+.+ |.|/. +-+.. ....+-+-+-+-+-+-+ .../././././././| ..+-+-+-+-+-+-+.+ ./././././././|/| +-+-+-+-+-+-+.+.+ |.|.|.|.|.|.|/|/| +-+-+-+-+-+-+.+.+ |.|.|.|.|.|.|/|/| +-+-+-+-+-+-+.+.+ |.|.|.|.|.|.|/|/. +-+-+-+-+-+-+.+.. |.|.|.|.|.|.|/... +-+-+-+-+-+-+....
result:
ok 18 lines
Test #2:
score: 0
Accepted
time: 1ms
memory: 3628kb
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