Submission #1065674
Source Code Expand
#include <stdio.h> #include <string.h> #include <stdbool.h> #define N_MAX 1000 #define M_MAX 200000 #define INF 10000000 #define MOD 1000000007 #define SMAP(a, b) ((a)!=(b))&&((a)^=((b)^=((a)^= (b)))) typedef unsigned long long ull; typedef signed long long dll; int n, m; int i, j, k; int a; bool h[N_MAX]; typedef struct { int in; int out; } twoway; void deb(){ return; } void fill(int x){ for (k = 2; x * k <= n; k++) { h[x * k - 1] = 0; } return; } int kou(int x){ int y = n; int u = 1; while (y /= x) { u += y; } return u; } void solve(){ ull result = 1; int prev; for (i = 0; i < n; i++) h[i] = !!i; for (i = 1; i < n; i++) { if (!h[i]) continue; prev = kou(i + 1); result *= (ull)prev; result %= MOD; fill(i + 1); } printf("%d\n", result); return; } int main (void) { scanf("%d", &n); solve(); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | sheyasutaka |
Language | C (GCC 5.4.1) |
Score | 300 |
Code Size | 940 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘solve’: ./Main.c:61:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘ull {aka long long unsigned int}’ [-Wformat=] printf("%d\n", result); ^ ./Main.c: In function ‘main’: ./Main.c:66: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 | 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 |