2 条题解

  • 0
    @ 2025-4-12 20:19:54
    aim = input().lower()
    string = ' ' + input().lower() + ' '
    count = 0
    length = len(aim)
    for i in range(len(string)-length):
        if string[i:i + length + 2] == ' ' + aim + ' ':
            count += 1
            if count == 1:
                position = i
    if count == 0:
        print(-1)
    else:
        print(count,position)
    

    确实简单一点点,@玉米大帝

    【深基6.例7】[NOIP2011 普及组] 统计单词数

    信息

    ID
    701
    时间
    1000ms
    内存
    256MiB
    难度
    9
    标签
    递交数
    11
    已通过
    3
    上传者