Submission #3000384
Source Code Expand
//If you are trying to hack me I wish you can get it, Good Luck :D. #include <bits/stdc++.h> using namespace std; #define debug(args...) fprintf (stderr,args) #define pb push_back #define mp make_pair typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const int MAX = 1123; const ll MOD = 1000000007; int crivo[MAX]; int n; int main() { cin.sync_with_stdio(false); cin.tie(0); for (int i = 2; i < MAX; i++) { if (crivo[i] == 0) { for (int k = i * i; k < MAX; k += i) crivo[k] = i; } } map<int, int> factors; ll ans = 1; cin >> n; for (int i = 1; i <= n; i++) { int num = i; while (num > 1) { if (crivo[num] > 0) { factors[crivo[num]]++; num /= crivo[num]; } else { factors[num]++; num = 1; } } } for (auto e : factors) { ans = (ans * ((ll)e.second + 1LL)) % MOD; } cout << ans << '\n'; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | vjudge2 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1060 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
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 | 1 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 | 1 ms | 256 KB |
subtask_1_certain_04.txt | AC | 1 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 |