跳到正文

个人记录

U295667 音乐

Lacko约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2025年12月12日
篇幅
约 1 分钟

版本

  1. v2当前
  2. v1

暴力思路

C++
#include<bits/stdc++.h>
using namespace std;
long long int d,a,s,p=0;
void ppp(int z,int x){
	if(z==a){p++;return;}
	if(x==d){return;}
	if((x<s&&z<1)||x>=s)ppp(z+1,x+1);
	ppp(z,x+1);
}
int main(){
	ios::sync_with_stdio(0);
	cin>>a>>s>>d;
	ppp(0,0);
	if(p==10)p=9;
	cout<<p<<endl;
    return 0;
}
原文