Submission #1166234
Source Code Expand
#include <iostream> #define mp make_pair #define pb push_back #define F first #define S second #define ll long long #define ld long double #define sz(a) ((int)(a).size()) #define clr(a,v) memset(a, v, sizeof(a)) #define all(a) (a).begin(),(a).end() #define pii pair<int,int> #define pdd pair<ld,ld> #define rep(i,a,b) for(int i=a; i<b; i++) #define dec(i,a,b) for(int i=a; i>=b; i--) #define ler freopen("inspection.in","r",stdin);freopen("inspection.out","w",stdout) #define fastio ios::sync_with_stdio(0), cin.tie(0) #define debug cout<<"!!?!!\n" using namespace std; #define PI 2*asin(1) #define EPS 1e-9 #define MOD 1000000007 #define MAXN 101002 #define INF 2e9 int cont[1000]; void decomp(int n){ for(int i=2; i<=n && n>1; i++){ while(n%i==0){ cont[i]++; n/=i; } } } ll ans(){ ll r=1; rep(i,0,1000){ r*= (cont[i]+1); r%= MOD; } return r; } int main(){ int n; cin >> n; rep(i,2,n+1) decomp(i); cout << ans() << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | railtont |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1036 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 256 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 | 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 |