| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 110482 | tincamatei | Cultivation (JOI17_cultivation) | C++14 | 2054 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 300;
int lc[MAX_N], cc[MAX_N];
int main() {
#ifdef HOME
FILE *fin = fopen("input.in", "r");
FILE *fout = fopen("output.ok", "w");
#else
FILE *fin = stdin;
FILE *fout = stdout;
#endif
int n, r, c, rez = 1000000000;
fscanf(fin, "%d%d", &r, &c);
fscanf(fin, "%d", &n);
for(int i = 0; i < n; ++i)
fscanf(fin, "%d%d", &lc[i], &cc[i]);
for(int down = 0; down <= r; ++down)
for(int up = 0; up <= r; ++up)
for(int left = 0; left <= c; ++left)
for(int right = 0; right <= c; ++right) {
bool okconf = true;
for(int lin = 1; lin <= r; ++lin)
for(int col = 1; col <= c; ++col) {
bool ok = false;
for(int i = 0; i < n; ++i)
if(lc[i] - down <= lin && lin <= lc[i] + up &&
cc[i] - left <= col && col <= cc[i] + right)
ok = true;
if(!ok)
okconf = false;
}
if(okconf)
rez = min(rez, left + up + down + right);
}
fprintf(fout, "%d", rez);
fclose(fin);
fclose(fout);
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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
