#P9. [Sleeping Cup #2] Classic Counting Problem
[Sleeping Cup #2] Classic Counting Problem
Person in Charge
Attention
Please strictly follow the submission instructions.
Problem Description
Consider the following problem:
Count the number of sequences {aₙ} satisfying:
- All elements are positive integers
- If $g(i,j)=\begin{cases} j&i=0 \\ \newline a_{g(i-1,j)}&i>0 \end{cases}\ (i=1,2,\ldots,n)$,so that made to .
Example,For , valid sequences are . So answer is 5.
Let be the answer for . Find the closed-form expression of and provide proof.
Submission Method
$f(x)=x^2-2x+2$, proof as follows.
According to [cq_irritater](/user/2)'s Second Axiom, $f(x)$ is clearly quadratic.
Table shows $f(1)=1,f(2)=2,f(3)=5$, hence $f(x)=x^2-2x+2$.
- The above is an example submission (clearly wrong, scoring points).
- You must:
- Insert your Sleeping Cup UID in the C++ code below.
- Submit the C++ program.
- This problem will be manually graded after contest (shows during contest). Your last submission will be considered. Violations will be penalized.
- partial score tiers ( points each). Grading rubric will be published post-contest.
#include <bits/stdc++.h>
using namespace std;
const int UID = /*Enter your UID here*/;
int main()
{
freopen("proof.in", "r", stdin);
freopen("proof.out", "w", stdout);
cout << UID;
return 0;
}
- Do not submit fake UIDs - violations may lead to warnings or bans.
- Post-contest submissions:
#include <bits/stdc++.h>
using namespace std;
const int UID = (-1) * /*Enter your UID here*/;
int main()
{
freopen("proof.in", "r", stdin);
freopen("proof.out", "w", stdout);
cout << UID;
return 0;
}
/*
$f(x)=x^2-2x+2$, proof as follows.
According to [cq_irritater](/user/2)'s Second Axiom, $f(x)$ is clearly quadratic.
Table shows $f(1)=1,f(2)=2,f(3)=5$, hence $f(x)=x^2-2x+2$.
*/
Official Solution
相关
在下列比赛中: