| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 39382 | pce913 | 보물 찾기 (CEOI13_treasure2) | C++14 | 0 ms | 1820 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "treasure.h"
#include<algorithm>
using namespace std;
int total;
int M[405][405];
int n;
void find_ans(int cx,int cy,int len){
	if (len == 1){
		M[cx][cy] = countTreasure(cx, cy, cx, cy) == 1;
		return;
	}
	int sum = countTreasure(cx, cy, min(n, cx + len - 1), min(n, cy + len - 1));
	if (sum != len * len){
		find_ans(cx, cy, len / 2);
		find_ans(cx + len/2, cy, len / 2);
		find_ans(cx, cy + len / 2, len / 2);
		find_ans(cx + len / 2, cy + len / 2, len / 2);
	}
	else{
		for (int i = cx; i <= cx + len - 1; i++){
			for (int j = cy; j <= cy + len - 1; j++){
				M[i][j] = 1;
			}
		}
	}
}
const int BOUND = 128;
void  findTreasure(int N) {
	n = N;
	total = countTreasure(1, 1, N, N);
	find_ans(1, 1, BOUND);
	for (int i = 1; i <= n; i++){
		for (int j = 1; j <= n; j++){
			if (M[i][j] == 1)
				Report(i, j);
		}
	}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
