记录编号 321965 评测结果 AAAAAAAAAA
题目名称 [NOIP 2008]立体图 最终得分 100
用户昵称 GravatarKZNS 是否通过 通过
代码语言 C++ 运行时间 0.004 s
提交时间 2016-10-14 11:59:39 内存使用 0.53 MiB
显示代码纯文本
//KZNS
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
char ds[500][500];
char md[6][8] = {
    "+---+..",
    "|   |/.",
    "|   | +",
    "+---+ |",
    "./   /|",
    "..+---+"
};
int init() {
    memset(ds, '.', sizeof(ds));
}
int mX = 0, mY = 0;
void don(int x, int y) {
    mX = max(mX, x+6);
    mY = max(mY, y+7);
    for (int i = 0; i < 6; i++)
        for (int j = 0; j < 7; j++)
            if (md[i][j] != '.')
                ds[x+i][y+j] = md[i][j];
}
void pf() {
    for (int i = mX - 1; i >= 0; i--) {
        for (int j = 0; j < mY; j++)
            printf("%c", ds[i][j]);
        printf("\n");
    }
}
void work() {
    int N, M;
    int H;
    int x, y;
    scanf("%d %d", &N, &M);
    for (int n = N-1; n >= 0; n--) {
        x = n * 2;
        y = n * 2;
        for (int m = 0; m < M; m++) {
            scanf("%d", &H);
            for (int h = 0; h < H; h++)
                don(x + h * 3, y);
            y += 4;
        }
    }
}
int main() {
    freopen("drawingu.in", "r", stdin);
    freopen("drawingu.out", "w", stdout);
    init();
    work();
    pf();
    return 0;
}
//UBWH
/*
..+---+
./   /|
+---+ |
|   | +
|   |/.
+---+..
*/