/ SeriousOJ /

Record Detail

Compile Error

foo.c:2:10: fatal error: iostream: No such file or directory
    2 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.

Code


#include <iostream>
//minhazchyz
#include<bits/stdc++.h>
#include <vector>
#include <map>
#include <cmath>

const int m= 1000000007;
void fact(int num, std::map<int, int> &cnt) {
    for (int i = 2; i <= std::sqrt(num);i++) {
        while (num % i == 0) {
            cnt[i]++;
            num /= i;
        }
    }
    if (num > 1) {
        cnt[num]++;
    }
}
int main() {
    int n;
    std::cin >> n;
    std::vector<int> A(n);
    for (int i = 0; i < n; ++i) {
        std::cin >> A[i];
    }

    std::map<int,int>cnt;
    for (int i = 0; i < n; ++i) {
        fact(A[i],cnt);
    }
    long long td = 1;
    for (const auto&entry:cnt) {
        td=(td* (entry.second + 1)) %m;
    }
    std::cout <<td<< std::endl;
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1060 Divisor
Language
C99 (GCC 13.2.0)
Submit At
2024-05-19 10:33:17
Judged At
2024-11-11 03:30:06
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes