RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00640

Bojanje

Unrated 레이팅 미적용
난이도
1s
시간 제한
512MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Oliver is a rubber duck that, not only finds bugs, but also likes to paint. His latest
painting has \(n\) parts, each coloured with a unique colour. After he got a lot of
critiques his painting is too predictable, he decided to modify his painting in \(t\)
iterations. In every iteration he will do the following steps:
1. Oliver will select uniformly at random an index \(i\) (\(1 \le i \le n\)), and memorize
the colour on the \(i-th\) part od the painting.
2. Again, Oliver will select uniformly at random an index \(j\) (\(1 \le j \le n\)). He
will repaint the \(j-th\) part of the painting with the colour of the \(i-th\) part od the painting. If the \(j-th\)
part is already painted in that colour, there is no change. Note that \(i\) can be equal to \(j\).
Now, Oliver is afraid his painting will become monotonous or boring. He considers a painting good if
there are at least \(k\) differents colours on it. Help him calculate the probability that his painting will be
good at the end.

제약

Subtask 1 (30 points): \(k = n\)

Subtask 2 (40 points): \(t \le 1\,000\)

Subtask 3 (40 points): No additional constraints.

입력 형식

The first line contains the numbers from the task statement \(n\), \(t\) and \(k\) (\(2 \le k \le n \le 10\), \(1 \le t \le 10^{18}\)).

출력 형식

In the first and only line output the answer modulo \(10^{9} + 7\).
Formally, let \(m = 10^{9} + 7\). It can be shown that the answer can be expressed as an irreducible fraction ^{p}
\(q\) ^{,}
where \(p\) and \(q\) are integers and \(q\)̸ ≡0
(mod \(m\)). Output the integer equal to \(p \cdot q\){−} mod \(m\). In other
words, output such an integer \(x\) that \(0 \le x < m\) and \(x \cdot q\)\(p\)
(mod \(m\)).

서브태스크
서브태스크점수설명

1

30점

\(k = n\)

2

40점

\(t \le 1\,000\)

3

40점

No additional constraints.

예제 1
입력
2 1 2
출력
500000004
예제 2
입력
10 2 5
출력
1
예제 3
입력
3 141592653589793 2
출력
468261332
설명

Clarification of the first example:
On the painting there are two colours, so the probability that it remains the same after one iteration is 1
2.
Clarification of the second example:
After two iterations, the number of different colours can’t go from 10 to less than 5, so in every case the
painting will have at least 5 different colours.

문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2022/2023 Contest 4

평가 및 의견

Bojanje

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Bojanje

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8