사용자 도구

사이트 도구


ps:problems:boj:20296

폰친구

ps
링크acmicpc.net/…
출처BOJ
문제 번호20296
문제명폰친구
레벨플래티넘 4
분류

조합론

시간복잡도O(n*m)
인풋사이즈n<=1000, m<=1000
사용한 언어Python 3.13
제출기록80228KB / 188ms
최고기록188ms
해결날짜2026/04/09

풀이

코드

"""Solution code for "BOJ 20296. 폰친구".

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

Tags: [combinatorics]
"""

from teflib import combinatorics

MOD = 10**9 + 7


def main():
    N, m, M, K = [int(x) for x in input().split()]
    print(combinatorics.count_compositions(K, N, MOD, lo=m, hi=M))


if __name__ == '__main__':
    main()

토론

댓글을 입력하세요:
Y O L G᠎ Y
 
ps/problems/boj/20296.txt · 마지막으로 수정됨: 2026/04/09 11:07 저자 teferi