Output Example
| poll question one |
| difficulty level: B; run time limit: 1000ms; operating space limit: 256000KB; code length limit: 2000000B |
| Question Description |
| Ouyangwen and Yi等 campaign chairman, Wangliangsen is responsible for recount, a total of M+n Zhang, the result Ouyangwen win, known Ouyangwen and Yi等 respectively obtained m-ticket and N-ticket (m>n). Now, please calculate how many Ouyangwen the number of votes in the recount process is always more than the number of yi等 votes. |
| input |
| row, including two numbers, m and n |
| output |
| A number that represents the number of scenarios that meet the requirements of the topic. |
| Input Example |
| 2 1 |
| 1 |
| Other instructions |
| data range: 1 <= m,n < 20 . |
#include <iostream>
using namespace Std;
int cnt,m,n;
void Dfs (int a, int b)
{
if (A <= b| | A> m| | B > N) return;
else if (a==m&&b==n) cnt++;
Else{dfs (a,b+1);d FS (a+1,b);}
}
int main ()
{
cin>>m>>n;
DFS (1,0);
cout<<cnt;
}
Poll Question One (c + +)