QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#521713#7042. So EasychenyueshanCompile Error//Python3670b2024-08-16 14:07:442024-08-16 14:07:45

Judging History

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

  • [2024-08-16 14:07:45]
  • 评测
  • [2024-08-16 14:07:44]
  • 提交

answer

x, y, z = input().split()
x = int(x)
y = int(y)
n = 0
for c in z:
    if 'a' <= c <= 'z':
        d = ord(c) - ord('0')
    elif 'A' <= c <= 'Z':
        d = ord(c) - ord('A') + 10
    else:
        d = orc(c) - ord('a') + 36
    n = x * n + d;
s = ""
if n == 0:
    print(0)
else:
    while n != 0:
        d = n % y
        if d < 10:
            s += str(d)
        elif d < 36:
            s += chr(ord('A') + d - 10)
        else:
            s += chr(ord('a') + d - 36)
        n //= y
    for i in range(len(s) - 1, -1, -1):
        print(s[i], end = '')
    print()

详细

  File "answer.code", line 6
        if 'a' <= c <= 'z':
    ^
SyntaxError: invalid non-printable character U+00A0