| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 76729 | kdh9949 | 마스코트 (JOI13_mascots) | C++17 | 120 ms | 93304 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
