Submission #3011497
Source Code Expand
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <queue> #include <string> #include <set> #include <map> #define REP(i,n) for(ll i = 0; i < (ll)n; i++) #define INF 1000000000000000 using namespace std; typedef long long ll; typedef double db; typedef string str; bool is_prime(ll n){ for(ll i = 2; i * i<=n; i++){ if(n%i==0) return false; } return n!=1; } int main(){ ll n; cin >> n; map<ll,ll> res; for(ll j = 1; j<= n; j++){ ll s = j; for(ll i = 2; i*i <= n; i++){ while(s%i==0){ ++res[i]; s/=i; } } if(s!=1) res[s]++; } ll ans = 1; for(ll j = 1; j <= n; j++){ ans = ans * (res[j]+1) % 1000000007; } cout << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | nexusuica |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 813 Byte |
Status | AC |
Exec Time | 2 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 | 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 |