QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#619689#8932. Bingoucup-team4074#Compile Error//C++20786b2024-10-07 15:02:362024-10-07 15:02:37

Judging History

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

  • [2024-10-07 15:02:37]
  • 评测
  • [2024-10-07 15:02:36]
  • 提交

answer

t = int(input())
for _ in range(t):
    n_s, m_s = input().split(' ')
    n_i, m_i = int(n_s), int(m_s)
    n_i = max(n_i, m_i - 1)
    n_s = str(n_i)
    res = n_i + m_i - n_i % m_i
    if str(n_i + 1).find(m_s) != -1:
        print(min(n_i + 1, res))
        continue

    len_n = len(n_s)
    len_m = len(m_s)
    l, r = len_n - len_m, len_n
    for __ in range(len_n - len_m + 1):
        sub_n_s = n_s[l:r]
        if l == len_n - len_m:
            if int(sub_n_s) < m_i:
                res = min(res, int((n_s[0:l] + m_s).ljust(len_n, '0')))
                break
        else:
            if int(sub_n_s) <= m_i:
                res = min(res, int((n_s[0:l] + m_s).ljust(len_n, '0')))
                break
        l -= 1
        r -= 1
    print(res)

詳細信息

answer.code:1:1: error: ‘t’ does not name a type
    1 | t = int(input())
      | ^