4 条题解

  • 1
    @ 2025-7-17 16:58:01
    #include <bits/stdc++.h>
    using namespace std;
    const int N=1e4+10;
    int n, a[N][N],ans=1,t;
    void f(int n,int last){
        for(int i=last;i<=n/2;i++){
        	if(n%i==0&&i<=n/i){
        		ans++;
        		f(n/i,i);
    		}
    	}
        
    }
    int main(){
        cin>>t;
        while(t--){
        	cin>>n;
        	f(n,2);
        	cout<<ans<<endl;
        	ans=1;
    	}
        return 0;
    }
    
    
    • 0
      @ 2025-6-14 19:24:28
      #include <bits/stdc++.h>
      using namespace std; 
      int f(int a, int b) 
      { 
          if(a==1) return 1; 
          int s=0; 
          for(int i=b;i <= a;i++) 
              if(a % i == 0) s+=f(a/i,i); 
          return s; 
      } 
      int main() 
      { 
          int n; 
          cin >> n; 
          while(n--) 
          { 
              int x; 
              cin >> x; 
              cout<<f(x,2)<<"\n"; 
          } 
          return 0; 
      }
      
      • 0
        @ 2025-6-14 19:21:03
        #include <bits/stdc++.h>
        using namespace std;
        #define LL long long
        const int N = 1e5 + 10;
        const int INF = 0x3f3f3f3f;
        int f(int a, int b)
        { if(a==1) return 1; int s=0; for(int i=b;i <= a;i++) if(a % i == 0) s+=f(a/i,i); return s; } int main() { int n; cin >> n; while(n--) { int x; cin >> x; cout<<f(x,2)<<"\n"; } return 0; }
        //菜鸟驿站
        //老六专属
        • -1
          @ 2023-12-10 8:59:20

          #include using namespace std; int f(int a, int b) { if(a==1) return 1; int s=0; for(int i=b;i <= a;i++) if(a % i == 0) s+=f(a/i,i); return s; } int main() { int n; cin >> n; while(n--) { int x; cin >> x; cout<<f(x,2)<<"\n"; } return 0; }

          • 1

          信息

          ID
          1232
          时间
          1000ms
          内存
          128MiB
          难度
          5
          标签
          递交数
          284
          已通过
          99
          上传者