Submission #3426343
Source Code Expand
#include <iostream> #include <map> using namespace std; typedef long long ll; const ll MOD = 1000000007; int ff(int n) { map<int, int> factors; for(int t=2; t<=n; t++) { int x = t; int p = 2; while(x>=p*p) { if(x%p==0) { x /= p; factors[p] += 1; } else { p += (p==2) ? 1 : 2; } } if(x>1) factors[x] += 1; } ll res = 1; for(auto &a : factors) { res = (res * (a.second+1)) % MOD; } return res; } int main() { int n; cin >> n; cout << ff(n) << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | refle |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 673 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 |