| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 19678 | 王循 | 求完全数的个数 | C++ | Wrong Answer | 0 | 0 MS | 248 KB | 321 | 2021-05-19 17:45:02 |
#include<bits/stdc++.h> using namespace std; int n,ls,s; 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; }