QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#706859#9521. Giving Directions in Harbinvanthoci#WA 11ms10584kbPython3429b2024-11-03 13:43:212024-11-03 13:43:21

Judging History

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

  • [2024-11-03 13:43:21]
  • 评测
  • 测评结果:WA
  • 用时:11ms
  • 内存:10584kb
  • [2024-11-03 13:43:21]
  • 提交

answer

d = 'NESW'
def dir(a, b):
    a = d.find(a)
    b = d.find(b)
    return (a - b + 4) % 4
    

T = int(input())
for _ in range(T):
    ans = []
    ind = 'N'
    m = int(input())
    for i in range(m):
        x, y = input().split()
        z = dir(ind, x)
        for j in range(z): ans.append(['L'])
        ans.append(['Z', y])
        ind = x
    print(len(ans), 'N')
    for a in ans:
        print(*a)

詳細信息

Test #1:

score: 0
Wrong Answer
time: 11ms
memory: 10584kb

input:

1
2
S 2
E 1

output:

5 N
L
L
Z 2
L
Z 1

result:

wrong answer Should start with `Z` (test case 1)