Submission #11459182
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define repd(i,a,b) for (int i=(a);i<(b);i++) #define rep(i,n) repd(i,0,n) #define all(x) (x).begin(),(x).end() template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } typedef long long ll; const long long INF = 1LL << 60; const long long MOD = 1e9 + 7; typedef pair<int, int> P; map<ll, ll> res; void prime_factor(ll N) { for (ll i = 2; i * i <= N; i++) { while(N % i == 0) { ++res[i]; N /= i; } } if (N != 1) res[N]++; } int main() { int N; cin >> N; ll ans = 1; repd(i, 1, N + 1) prime_factor(i); for (auto itr = res.begin(); itr != res.end(); itr++) { ans *= (itr->second + 1); ans %= MOD; } cout << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | wolley |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 964 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 |