Submission #1065603
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define FOR(i,l,r) for(int i = (int) (l);i < (int) (r);i++) #define ALL(x) x.begin(),x.end() template<typename T> bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; } template<typename T> bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; } typedef long long ll; ll N; const ll MOD = 1e9 + 7; int main() { scanf("%lld",&N); map<ll,ll> fact; for(ll i = 1;i <= N;i++){ ll t = i; for(ll j = 2;j * j <= t;j++){ while(t % j == 0){ fact [j]++; t /= j; } } if(t != 1) fact [t]++; } ll ans = 1; for(const auto& it : fact){ (ans *= it.second + 1) %= MOD; } printf("%lld\n",ans); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | gigime |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 735 Byte |
Status | AC |
Exec Time | 3 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:15:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%lld",&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 | 2 ms | 256 KB |
sample_02.txt | AC | 3 ms | 256 KB |
sample_03.txt | AC | 3 ms | 256 KB |
subtask_1_certain_01.txt | AC | 3 ms | 256 KB |
subtask_1_certain_02.txt | AC | 3 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 | 3 ms | 256 KB |
subtask_1_rand_02.txt | AC | 3 ms | 256 KB |
subtask_1_rand_03.txt | AC | 3 ms | 256 KB |