提交时间:2021-05-19 17:44:49

运行 ID: 19677

#include<bits/stdc++.h> using namespace std; int n,ls,s=1; bool wms(int w) { int sum=0; for(int i=1; i*i<=w; i++)if(w%i==0)sum+=i+(w/i); cout<<sum<<endl; if(w==sum/2)return 1; return 0; } int main() { cin>>n; for(int i=1;ls<=n;i+=2) { ls+=i*i*i; if(wms(ls)&&ls<=n)s++; } cout<<s<<endl; }