Submission #3000335


Source Code Expand

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <unistd.h>
#include <utility>
#include <vector>
#define int ll
#define dbc(x) //cerr << x << '\n'
#define dbn(x) //cerr << #x << " == " << x << '\n'
#define pb push_back
#define endl '\n'

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

//
const int MOD = 1e9 + 7;
map<int, int> him;
map<int, int> glob;

bool sieve[10000];

void sie(int n) {
	memset(sieve, 1, sizeof sieve);
	sieve[0] = sieve[1] = 0;
	for (int i=2; i*i <= n; i++) {
		if (sieve[i]) {
			for (int j=i*i; j<n; j+=i) {
				sieve[j] = false;
			}
		}
	}
}

void fac(int m) {
	him.clear();

	for (int i=2; i <= m; i++) {
		while (m % i == 0) {
			him[i]++;
			m /= i;
		}
	}

	for (auto i : him) {
		dbn(i.first);
		dbn(i.second);
		glob[i.first] += i.second;
	}
	dbc("====");
}

main(){
	ios::sync_with_stdio(false), cin.tie(0);

	int n; cin >> n;
	sie(n);

	for (int i=2; i<=n; i++) {
		fac(i);
	}

	int resp = 1;
	for (auto i : glob) {
		resp = (resp * (i.second + 1)) % MOD;
	}

	cout << resp << endl;
}

Submission Info

Submission Time
Task C - Factors of Factorial
User vjudge4
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1349 Byte
Status AC
Exec Time 3 ms
Memory 256 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 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 3 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 3 ms 256 KB
subtask_1_certain_04.txt AC 3 ms 256 KB
subtask_1_rand_01.txt AC 2 ms 256 KB
subtask_1_rand_02.txt AC 2 ms 256 KB
subtask_1_rand_03.txt AC 2 ms 256 KB