Logo
(追記) (追記ここまで)

25837번 - Boring Solitaire 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB0000.000%

문제

During quarantine, Stacking-Knightro (SK) made a new card game. SK respects social distancing and, since SK didn’t have other people around, the game is a type of solitaire. SK will shuffle a deck of cards. Then, at every step, SK takes the card at the top of the deck. When taking the card, SK will place the card on top of one of the existing piles of cards or will make a new pile with this card as the top. SK can only place a card on top of a pile if the value of the card is not less than the card at the top of the pile. The goal of the game is to minimize the number of piles when the deck is empty.

Stacking-Knightro started getting pretty good “score” before too long, so the game became pretty boring once SK figured out the “trick”. SK wants to know how many different starting card arrangements will end up with at most K piles if the game is played optimally at each step, i.e., each card is placed such that it will result in the best outcome.

We have a deck of cards with values 1 through V and a number of suits S, i.e., there are “(V × S)!” arrangements of the cards in the deck (note that “!” refers to the factorial of an integer). Using the game description above and a desired maximum of K piles, you are to determine how many different starting card orders will end up with at most K piles. Since this value can be large, print the output mod 1,000,000,007.

입력

There is only one input line; it contains three integers: V (1 ≤ V ≤ 100), representing the number of card values (values are 1 through V), S (1 ≤ S ≤ 10,000), representing the number of suits, and K (1 ≤ K ≤ V ≤ 100), representing the maximum number of piles allowed.

출력

Print how many different starting card orders will end up with at most K piles.

제한

예제 입력 1

2 2 1

예제 출력 1

4

예제 입력 2

4 3 3

예제 출력 2

763937568

예제 입력 3

3 1 3

예제 출력 3

6

힌트

Explanation of the first Sample Input/Output:

There are two card values, two suites, and one pile. There are four card arrangements to win the solitaire:

  1. 1s1 1s2 2s1 2s2
  2. 1s1 1s2 2s2 2s1
  3. 1s2 1s1 2s1 2s2
  4. 1s2 1s1 2s2 2s1

출처

University > University of Central Florida > 2020 Local Programming Contest (Final Round) 10번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /