Submission #1068667
Source Code Expand
#include <cstdio> #include <cstring> using namespace std; typedef long long ll; static const int MAX_N = 1001; static const ll MOD = 1e9 + 7LL; int main() { int isPrime[MAX_N]; memset(isPrime, 0, sizeof(isPrime)); int a, b; for (a = 2; a * a < MAX_N; a++) { if (isPrime[a] == 1) continue; for (b = a * a; b < MAX_N; b += a) isPrime[b] = 1; } int N; scanf("%d", &N); ll x = 1LL; int i, j, n; for (i = 2; i <= N; i++) { if (isPrime[i] == 0) { n = 1; for (j = i; j <= N; j *= i) n += N / j; x = (x * n) % MOD; } } printf("%lld\n", x); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | ishibashijun |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 725 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:26:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] 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 | 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 | 128 KB |
sample_02.txt | AC | 1 ms | 128 KB |
sample_03.txt | AC | 1 ms | 128 KB |
subtask_1_certain_01.txt | AC | 1 ms | 128 KB |
subtask_1_certain_02.txt | AC | 1 ms | 128 KB |
subtask_1_certain_03.txt | AC | 1 ms | 128 KB |
subtask_1_certain_04.txt | AC | 1 ms | 128 KB |
subtask_1_rand_01.txt | AC | 1 ms | 128 KB |
subtask_1_rand_02.txt | AC | 1 ms | 128 KB |
subtask_1_rand_03.txt | AC | 1 ms | 128 KB |