#include <unordered_map>
#include <iostream>
#include <vector>
#include <bitset>
#include <algorithm>
int res = 0;
int f(int apple, int plate){
if(plate > apple) return f(apple, apple);
if(apple == 0) return 1;
if(plate == 0) return 0;
return f(apple, plate - 1) + f(apple - plate, plate); //全部爲空+至少一個盤子爲空
}
using namespace std;
int main(){
int m, n;
scanf("%d,%d", &m, &n);
cout<<f(m, n)<<endl;
return 0;
}
分糖果
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
loj#2325. 「清華集訓 2017」小 Y 和恐怖的奴隸主 (矩陣快速冪優化概率dp)
bestFy
2020-07-08 05:07:32
ARC#058F Iroha Loves Strings(貪心+字符串處理+dp預處理)
bestFy
2020-07-08 05:07:31
P2401 不等數列
Harris-H
2020-07-08 03:45:44
【AC自動機複習】 noi2011阿狸的打字機
cjoilmd
2020-07-08 03:14:08
問題 B: 分院帽 (hat)----------------------------思維(並查集+0/1揹包)
AKone123456
2020-07-08 02:17:05
hdu 3998 (dp+最大流)
菜鸟起航
2020-07-08 01:39:23
[bzoj1087] [SCOI2005]互不侵犯King 狀壓dp
XStalker
2020-07-07 22:27:32
HDU 1423 求求求求求求最長上升公共子序列
陆历川在江湖
2020-07-07 21:41:11
POJ 2184 Cow Exhibition 01揹包
多A几道题就好
2020-07-07 20:53:03
遞歸之兔子問題
dreamer_96
2020-07-08 10:26:31
使用遞歸解決漢諾塔問題
YuJar
2020-07-08 10:22:34
使用遞歸實現全排列
KeepThinking_
2020-07-08 05:35:39
(C++)求解斐波那契數列.(遞歸與非遞歸)
菜鸡亮亮
2020-07-08 01:05:42