- #include<bits/stdc++.h>
- using namespace std;
- long long compute(long long a,long long b){
- if(b>6*a || b<0 || a<0){
- return 0;
- }else if(a==1){
- if(b<=6 && b>=1){
- return 1;
- }else{
- return 0;
- }
- }else{
- return compute(a-1,b-1)+compute(a-1,b-2)+compute(a-1,b-3)+compute(a-1,b-4)+compute(a-1,b-5)+compute(a-1,b-6);
- }
- }
- int main()
- {
- long long a,b;
- cin>>a>>b;
- cout<<compute(a,b);
- return 0;
- }
複製代碼 |