QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#606714#8932. BingoUESTC_DECAYALI#Compile Error//C++20591b2024-10-03 11:46:182024-10-03 11:46:20

Judging History

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

  • [2024-10-03 11:46:20]
  • 评测
  • [2024-10-03 11:46:18]
  • 提交

answer

def main():
    n, m = input().split()
    nn = int(n)
    mm = int(m)
    nn += 1
    sn = str(nn)
    ans = nn % mm
    if ans == 0:
        print(nn)
        return
    ans = mm - ans
    if sn.find(m) >= 0:
        print(sn)
        return
    if len(sn) < len(m):
        print(nn + ans)
        return
    for i in range(0, min(10, len(n) - len(m) + 1)):
        tail = int(sn[len(n) - (i + len(m)) : len(n) - i])
        if tail > mm: continue
        ans = min(ans, (mm - tail) * (10 ** i))
    print(nn + ans)

for testCase in range(int(input())):
    main()

詳細信息

answer.code:1:1: error: ‘def’ does not name a type
    1 | def main():
      | ^~~