# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
76729 | 2018-09-16T17:29:08 Z | kdh9949 | 마스코트 (JOI13_mascots) | C++17 | 120 ms | 93304 KB |
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 3005; const ll M = ll(1e9) + 7; int h, w, n, a, b, c, d, p[2 * N][2 * N]; ll r = 1; int main(){ scanf("%d%d%d%d%d", &h, &w, &n, &a, &b); c = a; d = b; for(int x, y, i = 0; i < n - 1; i++){ scanf("%d%d", &x, &y); tie(a, b) = minmax({a, b, x}); tie(c, d) = minmax({c, d, y}); } for(int i = 1; i <= (b - a + 1) * (d - c + 1) - n; i++) r = r * i % M; a = a - 1; c = c - 1; b = h - b; d = w - d; for(int i = 0; i < 2 * N; i++){ p[i][0] = 1; for(int j = 1; j <= i; j++) p[i][j] = (p[i - 1][j - 1] + p[i - 1][j]) % M; } printf("%lld\n", r * p[a + b + c + d][a + b] % M * p[a + b][a] % M * p[c + d][c] % M); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 120 ms | 93048 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 105 ms | 93304 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 103 ms | 93304 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |