# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
159710 | geon040702 | 고기잡이 (KOI13_fish) | C++14 | 132 ms | 508 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define inside(a, b, c) ((a)<=(c) && (c)<=(b))
int X[1000], Y[1000];
int Fx[1000], Fy[1000];
int main(void)
{
int N, M, L;
int i, j, k;
int w, h, cnt;
int res = 0;
scanf("%d %d %d", &N, &L, &M);
for (i = 0 ; i < M ; i++) {
scanf("%d %d", &Fx[i], &Fy[i]);
X[i] = Fx[i];
Y[i] = Fy[i];
}
std::sort(X, X+M);
std::sort(Y, Y+M);
L /= 2;
for (w = 1 ; w < L ; w++) {
h = L - w;
for (i = 0 ; i < M ; i++) {
for (j = 0 ; j < M ; j++) {
cnt = 0;
for (k = 0 ; k < M ; k++) {
if (inside(X[i], X[i] + w, Fx[k]) && inside(Y[j], Y[j] + h, Fy[k]))
cnt++;
}
if(res < cnt)
res = cnt;
}
}
}
printf("%d", res);
return 0;
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |