| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 19413 | 陈万瑄 | 求完全数的个数 | C++ | Time Limit Exceeded | 40 | 1000 MS | 244 KB | 290 | 2021-05-15 17:19:16 |
#include<bits/stdc++.h> using namespace std; int n,sum; int isPerfect(int x){ int s=1; for(int i=2;i*i<=x;i++){ if(x%i==0){ s+=i; s+=x/i; } } return s==x; } int main(){ cin>>n; for(int i=2;i<=n;i++){ if(isPerfect(i)) sum++; } cout<<sum; return 0; }