2 solutions

  • 5
    @ 2024-6-13 22:58:14

    这个是正解,但似乎比打表慢得多

    #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;
    }
    
    • 3
      @ 2024-1-23 10:38:43
      #include<bits/stdc++.h>
      using namespace std;
      
      int main(){
      	cout<<220<<' '<<284;
      	return 0;
      }
      

      不知道错哪了所以直接试答案

      • 1

      Information

      ID
      640
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      5
      Tags
      # Submissions
      46
      Accepted
      20
      Uploaded By