QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#263719#5101. Crystal CrosswindjuampiRE 0ms0kbPython31.2kb2023-11-25 04:39:552023-11-25 04:39:57

Judging History

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

  • [2023-11-25 04:39:57]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2023-11-25 04:39:55]
  • 提交

answer

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

while True:
    try:
        X, Y, N = map(int, input().split())
        g = [['' for _ in range(X+1)] for _ in range(Y+1)]
        wm = wn = [0] * N
        for i in range(N):
            wm[i], wn[i], B = map(int, input().split())
            for _ in range(B):
                x, y = map(int, input().split())
                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):
            print(''.join(g[y][1:X+1] if g[y][1:X+1] else '.'))
        print()
        for y in range(1, Y+1):
            print(''.join(g[y][1:X+1] if g[y][1:X+1] else '#'))
        print()
    except EOFError:
        break

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Dangerous Syscalls

input:

4 1 1
0 1 2 1 1 3 1

output:


result: