QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#263905#5101. Crystal CrosswindjuampiWA 14ms9168kbPython31.6kb2023-11-25 10:05:592023-11-25 10:05:59

Judging History

你现在查看的是最新测评结果

  • [2023-11-25 10:05:59]
  • 评测
  • 测评结果:WA
  • 用时:14ms
  • 内存:9168kb
  • [2023-11-25 10:05:59]
  • 提交

answer


def doit(x, y):
    ch = g[y][x] if (1 <= x <= X and 1 <= y <= Y) else '.'
    if ch is None:
        return
    i = 0
    for i in range(N):
        x2 = x + (wm[i] if ch == '.' else -wm[i])
        y2 = y + (wn[i] if ch == '.' else -wn[i])
        if 1 <= x2 <= X and 1 <= y2 <= Y:
            if g[y2][x2] is None:
                g[y2][x2] = ch
                doit(x2, y2)


while True:
    try:
        X, Y, N = map(int, input().split())
        g = [[None for _ in range(X + 1)] for _ in range(Y + 1)]
        wm = wn = [0] * N
        i = 0
        for i in range(N):
            line = input().split()
            wm[i] = int(line[0])
            wn[i] = int(line[1])
            B = int(line[2])
            pos = 3
            j = 0
            for j in range(B):
                x = int(line[pos])
                pos = pos + 1
                y = int(line[pos])
                pos = pos + 1
                g[y][x] = '#'
                x2, y2 = x - wm[i], y - wn[i]
                if 1 <= x2 <= X and 1 <= y2 <= Y:
                    g[y2][x2] = '.'

        for y in range(-Y, 2 * Y + 1):
            for x in range(-X, 2 * X + 1):
                doit(x, y)

        for y in range(1, Y + 1):
            for x in range(1, X + 1):
                print(g[y][x] if g[y][x] else '.', end='')
            print()
        print()

        for y in range(1, Y + 1):
            for x in range(1, X + 1):
                print(g[y][x] if g[y][x] else '#', end='')
            print()
    except EOFError:
        break

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 9088kb

input:

4 1 1
0 1 2 1 1 3 1

output:

#.#.

#.#.

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 14ms
memory: 9168kb

input:

4 4 2
1 0 4 2 4 2 1 1 3 1 2
-1 0 4 4 3 4 2 3 1 3 4

output:

....
....
....
....

#..#
.##.
.##.
#..#

result:

wrong answer 1st lines differ - expected: '.##.', found: '....'