Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46495 | Jerry | 求和比较 | C++ | Compile Error | 0 MS | 0 KB | 263 | 2024-05-04 09:55:03 |
#include<bits/stdc++.h> using namespace std; int n,m,cnt; void dfs(int n,int m){ if(n==0) cnt++; if(m>n) return ; for(int i=m;i<=n;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; }