3 条题解

  • 1
    @ 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; }
    //菜鸟驿站
    //老六专属
    • 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; 
      }
      
      • -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
        标签
        递交数
        215
        已通过
        86
        上传者