Submission #2235019
Source Code Expand
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <queue> #include <limits> #include <map> #define REP(i,n) for(long (i)=0;(i)<(n);(i)++) #define REPI(i,a,b) for(long (i)=(a);(i)<(b);(i)++) #define INF numeric_limits<double>::infinity() constexpr long MOD = 1e9 + 7; using namespace std; using P = pair<long, long>; using VI = vector<long>; int d[1001]; void hoge(int n) { int i = 2; while (n != 1) { while (n % i == 0) { n /= i; d[i]++; } i++; } } int main() { long n; cin >> n; for (int i = n; i >= 2; i--) hoge(i); long ans = 1; REPI(i,2,n+1) { if (d[i]) { ans *= d[i] + 1; ans %= MOD; } } cout << ans << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | xuzijian629 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 823 Byte |
Status | AC |
Exec Time | 4 ms |
Memory | 384 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 | 4 ms | 384 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 |