Submission #3000347
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define debug(args...) fprintf(stderr,args) #define pb push_back #define mp make_pair const int N = 5e6 + 5; const int inf = 1791791791; const int mod = 1e9+7; typedef long long ll; int p[N]; int main() { int n; scanf("%d", &n); for (int i=2;i<=n;i++) { int pi = i; for (int j=2;pi != 1;j++) { while (pi%j == 0) { pi /= j; p[j]++; } } } long long resp = 1; for (int i=2;i<=n;i++) { resp *= (long long)(p[i] + 1); resp %= mod; } printf("%lld\n", resp); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | vjudge4 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 551 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:18:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] int n; scanf("%d", &n); ^
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 |