2 solutions
-
5
这个是正解,但似乎比打表慢得多
#include<bits/stdc++.h> using namespace std; int Factors(int n){ int sum=0; for(int t=1;t<=n/2;t++){ if(n%t==0)sum+=t; } return sum; } int main(){ int i=2; while(i++){ int f=Factors(i);//因子之和 if(Factors(f)==i&&i<f){ cout<<i<<" "<<f; break; } } return 0; }
- 1
Information
- ID
- 640
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- # Submissions
- 46
- Accepted
- 20
- Uploaded By