제출 #503217

#제출 시각아이디문제언어결과실행 시간메모리
503217rainboyMagneti (COCI21_magneti)C11
0 / 110
1 ms276 KiB
#include <stdio.h> #define N 50 #define MD 1000000007 int vv[N + 1], ff[N + 1], gg[N + 1]; void init() { int i; ff[0] = gg[0] = 1; for (i = 1; i <= N; 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:28:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   28 |  scanf("%d%d", &n, &l);
      |  ^~~~~~~~~~~~~~~~~~~~~
Main.c:30:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |   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...