Submission #3429706
Source Code Expand
#include <bits/stdc++.h> #include <unordered_set> using namespace std; #define ll long long #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define repeat(i,s,n) for(int (i)=s; (i)<(n); (i)++) const ll P = 1e9+7; int main() { cin.tie(0); ios::sync_with_stdio(false); cout<<setprecision(std::numeric_limits<float>::max_digits10); ll n; cin>>n; vector<bool> prime(n+1,true); repeat(i,2,n+1) { if(prime[i]) { repeat(j,2,n+1) { if(j*i>n) break; prime[j*i]=false; } } } vector<ll> ps; repeat(i,2,n+1){ if(prime[i]) ps.push_back(i); } vector<ll> cnt(n+1); repeat(i,2,n+1) { ll x = i; for(auto& p : ps) { while(x%p==0) { cnt[p]++; x/=p; } } } ll a = 1; rep(i,n+1) { a*=(cnt[i]+1); a%=P; } cout << a << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | ponpon05 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 881 Byte |
Status | AC |
Exec Time | 10 ms |
Memory | 764 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 | 10 ms | 764 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 |