Submission #2213158
Source Code Expand
#include<cstdio> #include<cstring> #include<algorithm> typedef long long LL; const LL mod=1e9+7; const int N=1006; using namespace std; LL f[N]; LL fun(int n) { LL ans=1; memset(f,0,sizeof(f)); for(int i=2;i<=n;i++) { int k=i; for(int j=2;j<=k;j++) { while(k%j==0) { f[j]++; k/=j; } } if(k) f[k]++; } for(int i=2;i<=n;i++) { if(f[i]) ans=ans*(f[i]+1)%mod; } return ans%mod; } int main() { int n; while(~scanf("%d",&n)) { printf("%lld\n",fun(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 | 512 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 128 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 | 128 KB |
sample_02.txt | AC | 1 ms | 128 KB |
sample_03.txt | AC | 1 ms | 128 KB |
subtask_1_certain_01.txt | AC | 1 ms | 128 KB |
subtask_1_certain_02.txt | AC | 1 ms | 128 KB |
subtask_1_certain_03.txt | AC | 1 ms | 128 KB |
subtask_1_certain_04.txt | AC | 1 ms | 128 KB |
subtask_1_rand_01.txt | AC | 1 ms | 128 KB |
subtask_1_rand_02.txt | AC | 1 ms | 128 KB |
subtask_1_rand_03.txt | AC | 1 ms | 128 KB |