Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46489 | 老方 | 求和比较 | C++ | Accepted | 1 MS | 248 KB | 250 | 2024-05-04 09:45:52 |
#include<bits/stdc++.h> using namespace std; int n1,m1,cnt; void dfs(int n,int m){ if(n==0)cnt++; if(m>n)return; for(int i=m;i<=n1;i++)dfs(n-i,i+1);} int main(){ cin>>n1>>m1; m1=(n1*(n1+1)/2-m1)/2; dfs(m1,1); cout<<cnt; return 0;}