QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#606917#8932. BingoUESTC_NLNS#Compile Error//C++14624b2024-10-03 12:58:152024-10-03 12:58:16

Judging History

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

  • [2024-10-03 12:58:16]
  • 评测
  • [2024-10-03 12:58:15]
  • 提交

answer

t = int(input())
for i in range(t):
    n1, m1 = input().split()
    n, m = map(int, [n1, m1])
    if n < m:
        print(m)
        continue
    a1 = (n // m + 1) * m

    n += 1
    n1 = str(n)
    if m1 in n1:
        print(n1)
        continue

    lm = len(m1)
    n21 = n1[: -2 * lm]
    n2 = n1[-2 * lm :]
    n2i = int(n2)
    # print(n2)
    a2 = 10**20
    for i in range(0, len(n2) - lm + 1):
        a3 = n2[:i] + m1 + n2[i + lm :]
        # print(a3)
        a3 = int(a3)
        if a3 >= n2i:
            a2 = min(a2, a3)

    a2 = int(n21 + str(a2))
    print(min(a1, a2))
# 6

詳細信息

answer.code:20:7: error: invalid preprocessing directive #print
   20 |     # print(n2)
      |       ^~~~~
answer.code:24:11: error: invalid preprocessing directive #print
   24 |         # print(a3)
      |           ^~~~~
answer.code:1:1: error: ‘t’ does not name a type
    1 | t = int(input())
      | ^