# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
210498 | alexandra_udristoiu | 보물 찾기 (CEOI13_treasure2) | C++14 | 6 ms | 552 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include "treasure.h"
using namespace std;
static int a[105][105];
void findTreasure (int n) {
int i, j, val;
for(i = n / 2 + 1; i <= n; i++){
for(j = n / 2 + 1; j <= n; j++){
a[i][j] = countTreasure(1, 1, i, j);
}
for(j = 1; j <= n / 2; j++){
a[i][j] = a[i][n] - countTreasure(1, j + 1, i, n);
}
}
for(i = n / 2; i >= 1; i--){
for(j = n / 2 + 1; j <= n; j++){
a[i][j] = a[n][j] - countTreasure(i + 1, 1, n, j);
}
for(j = n / 2; j >= 1; j--){
a[i][j] = a[i][n] + a[n][j] + countTreasure(i + 1, j + 1, n, n) - a[n][n];
}
}
for(i = 1; i <= n; i++){
for(j = 1; j <= n; j++){
val = a[i][j] - a[i - 1][j] - a[i][j - 1] + a[i - 1][j - 1];
if(val == 1){
Report(i, j);
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |