제출 #503218

#제출 시각아이디문제언어결과실행 시간메모리
503218rainboyMagneti (COCI21_magneti)C11
10 / 110
1 ms392 KiB
#include <stdio.h> #define N 50 #define M 10000 #define MD 1000000007 int vv[M + 1], ff[M + 1], gg[M + 1]; void init() { int i; ff[0] = gg[0] = 1; for (i = 1; i <= M; i++) { vv[i] = i == 1 ? 1 : (long long) vv[i - MD % i] * (MD / i + 1) % MD; ff[i] = (long long) ff[i - 1] * i % MD; gg[i] = (long long) gg[i - 1] * vv[i] % MD; } } int choose(int n, int k) { return k < 0 || k > n ? 0 : (long long) ff[n] * gg[k] % MD * gg[n - k] % MD; } int main() { static int rr[N]; int n, l, i; init(); scanf("%d%d", &n, &l); for (i = 0; i < n; i++) scanf("%d", &rr[i]); printf("%lld\n", (long long) choose(l - (rr[0] - 1) * (n - 1), n) * ff[n] % MD); return 0; }

컴파일 시 표준 에러 (stderr) 메시지

Main.c: In function 'main':
Main.c:29:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   29 |  scanf("%d%d", &n, &l);
      |  ^~~~~~~~~~~~~~~~~~~~~
Main.c:31:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |   scanf("%d", &rr[i]);
      |   ^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...