01背包计算方案数
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+100,mod=1e9+7;
void add(ll &a,ll b){ a=(a+b+mod)%mod; }
int main(){
ll h,s,g,r,dp[N],ans=0;//dp[i]表示放了i个红方块一共有几种方案
cin>>r>>g;
s=g+r;
h=(sqrt(1+8*s)-1)/2;//s=h*(h+1)/2
memset(dp,0,sizeof(dp));
dp[0]=1;
for(int i=1;i<=h;i++)
for(int j=r;j>=i;j--)
add(dp[j],dp[j-i]);
ll num=h*(h+1)/2;
for(int i=0;i<=r;i++)
if(num<=g+i)add(ans,dp[i]);
cout<<ans<<endl;
}