Submission #2200916
Source Code Expand
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;
#define Rep(b, e, i) for(ll i = b; i <= e; i++)
#define rep(n, i) Rep(0, n-1, i)
typedef long long ll;
const ll MOD = 1000000007;
const int MAX = 1024;
bool prime[MAX];
ll dividetimes[MAX];
void solve(void){
//prime_table
rep(MAX, i) prime[i] = true;
prime[0] = prime[1] = false;
Rep(2, MAX, i) {
if (prime[i]) {
for (int k = 2; i * k <= MAX; k++){
prime[i*k] = false;
}
}
}
int N;
scanf("%d\n", &N);
Rep(2, N, n){
Rep(2, n, d) {
ll t = n;
if (prime[d]) {
while(t%d==0){
dividetimes[d]++;
t /= d;
}
}
}
}
ll ans = 1LL;
Rep(2, N, n){
ans *= (dividetimes[n]+1)%MOD;
ans %= MOD;
}
printf("%lld\n", ans);
}
int main(void){
solve();
return 0;
}
Submission Info
Submission Time |
|
Task |
C - Factors of Factorial |
User |
sifi_border |
Language |
C++14 (GCC 5.4.1) |
Score |
300 |
Code Size |
1166 Byte |
Status |
AC |
Exec Time |
3 ms |
Memory |
256 KB |
Compile Error
./Main.cpp: In function ‘void solve()’:
./Main.cpp:36:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d\n", &N);
^
./Main.cpp:29:20: warning: iteration 1022u invokes undefined behavior [-Waggressive-loop-optimizations]
if (prime[i]) {
^
./Main.cpp:13:38: note: containing loop
#define Rep(b, e, i) for(ll i = b; i <= e; i++)
^
./Main.cpp:28:5: note: in expansion of macro ‘Rep’
Rep(2, MAX, i) {
^
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 |
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 |