목차

준오는 심술쟁이!!

ps
링크acmicpc.net/…
출처BOJ
문제 번호14437
문제명준오는 심술쟁이!!
레벨골드 3
분류

조합론

시간복잡도O(n+k)
인풋사이즈n<=3000, k<=3000
사용한 언어Python 3.13
제출기록32412KB / 32ms
최고기록32ms
해결날짜2026/04/09

풀이

코드

"""Solution code for "BOJ 14437. 준오는 심술쟁이!!".

- Problem link: https://www.acmicpc.net/problem/14437
- Solution link: http://www.teferi.net/ps/problems/boj/14437

Tags: [combinatorics]
"""

from teflib import combinatorics

MOD = 1_000_000_007


def main():
    s = int(input())
    problem = input()
    print(combinatorics.count_compositions(s, len(problem), MOD, hi=25))


if __name__ == '__main__':
    main()