2 条题解

  • 0
    @ 2025-8-25 18:17:22

    不知道字符串范围是不是26个字母,加个if比较😄

    from math import sqrt,ceil,gcd,log;re=lambda:map(int,input().strip().split())
    t, = re()
    check = "ABCDEFGHIJKL"
    for _ in range(t):
        a, b = input().strip().split()
        b = int(b)
        print(len(set(a[i : i + b] for i in range(len(a) - b + 1) if all(j in check for j in a[i : i + b]))))
    
    
    • 0
      @ 2021-12-24 20:05:13

      此题仅需存储后比较即可,数据范围极小,暴力就行

      • 1

      信息

      ID
      560
      时间
      1000ms
      内存
      256MiB
      难度
      10
      标签
      (无)
      递交数
      6
      已通过
      3
      上传者