Submission #1066746
Source Code Expand
#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> int main(){ int n; scanf("%d",&n); int i,j,k; int insuu_cnt; int insuu_goukei[2000]={0}; //素因数分解 for(i=1;i<=n;i++){ insuu_cnt=0; k=i; while(k>1){ for(j=2;j<=k;j++){ if(k%j==0){ insuu_goukei[j]++; k/=j; break; } } } } long long int yakusuu_cnt=1; for(i=1;i<=1000;i++){ if(insuu_goukei[i]){ //printf("%d:%d\n",i,insuu_goukei[i]); } yakusuu_cnt = yakusuu_cnt * (insuu_goukei[i]+1) % 1000000007; } printf("%d\n",yakusuu_cnt); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | mono1977 |
Language | C (GCC 5.4.1) |
Score | 300 |
Code Size | 698 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:40:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=] printf("%d\n",yakusuu_cnt); ^ ./Main.c:11:2: warning: ignoring return value of ‘scanf’, 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 | 2 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 | 2 ms | 128 KB |
subtask_1_certain_04.txt | AC | 2 ms | 128 KB |
subtask_1_rand_01.txt | AC | 2 ms | 128 KB |
subtask_1_rand_02.txt | AC | 2 ms | 128 KB |
subtask_1_rand_03.txt | AC | 1 ms | 128 KB |