Submission #3000353


Source Code Expand

#include <bits/stdc++.h>
#define debug(args...) fprintf(stderr, args)
using namespace std;

const int MOD = 1e9 + 7;

typedef long long lint;

int main() {
    int n;
    vector<int> ps;
    cin >> n;
    for (int i = 2; i <= n; i++) {
        bool prime = true;
        for (int j = 2; prime && j * j <= i; j++) {
            if (!(i % j)) prime = false;
        }
        if (prime) ps.push_back(i);
    }
    lint ans = 1;
    for (int p : ps) {
        lint cnt = 0;
        for (int i = 2; i <= n; i++) {
            int j = i;
            while (!(j % p)) {
                cnt++;
                j /= p;
            }
        }
        ans = (ans * (1 + cnt)) % MOD;
    }
    cout << ans << endl;
    return 0;
}

Submission Info

Submission Time
Task C - Factors of Factorial
User vjudge4
Language C++14 (GCC 5.4.1)
Score 300
Code Size 720 Byte
Status AC
Exec Time 2 ms
Memory 384 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 10
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_certain_01.txt, subtask_1_certain_02.txt, subtask_1_certain_03.txt, subtask_1_certain_04.txt, subtask_1_rand_01.txt, subtask_1_rand_02.txt, subtask_1_rand_03.txt
Case Name Status Exec Time Memory
sample_01.txt AC 2 ms 384 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 2 ms 256 KB
subtask_1_certain_01.txt AC 1 ms 256 KB
subtask_1_certain_02.txt AC 1 ms 256 KB
subtask_1_certain_03.txt AC 2 ms 256 KB
subtask_1_certain_04.txt AC 2 ms 256 KB
subtask_1_rand_01.txt AC 1 ms 256 KB
subtask_1_rand_02.txt AC 1 ms 256 KB
subtask_1_rand_03.txt AC 1 ms 256 KB