Submission #39392

# Submission time Handle Problem Language Result Execution time Memory
39392 2018-01-13T14:50:50 Z pce913 Treasure (different grader from official contest) (CEOI13_treasure2) C++14
6 / 100
0 ms 3364 KB
#include "treasure.h"
#include<algorithm>
#include<iostream>
using namespace std;


int M[405][405];
int R[405][405];
int n;
const int BOUND = 128;
void find_ans(int cx,int cy,int len){
	if (cx > n || cy > n)
		return;
	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 != min(len,n-cx+1)*min(len,n-cy+1)){
		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 <= min(n, cx + len - 1); i++){
			for (int j = cy; j <= min(n, cy + len - 1); j++){
				M[i][j] = 1;
			}
		}
	}
}


void  findTreasure(int N) {
	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);
			}
		}
	}
}

Compilation message

grader.c: In function 'int main()':
grader.c:63:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         my_assert(strlen(A[i]+1) == N, "each line of the map must contain N zeroes or ones (before loop)");
                                  ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 3364 KB Output isn't correct - N = 5, K = 868, score = 0
2 Incorrect 0 ms 3364 KB Output isn't correct - N = 10, K = 12742, score = 0
3 Incorrect 0 ms 3364 KB Output isn't correct - N = 15, K = 50970, score = 0
4 Partially correct 0 ms 3364 KB Output is partially correct - N = 16, K = 62844, score = 1
5 Incorrect 0 ms 3364 KB Output isn't correct - N = 55, K = 11774351, score = 0
6 Incorrect 0 ms 3364 KB Output isn't correct - N = 66, K = 24268774, score = 0
7 Partially correct 0 ms 3364 KB Output is partially correct - N = 77, K = 29353046, score = 1
8 Partially correct 0 ms 3364 KB Output is partially correct - N = 88, K = 39340598, score = 4
9 Incorrect 0 ms 3364 KB Output isn't correct - N = 99, K = 121702381, score = 0
10 Incorrect 0 ms 3364 KB Output isn't correct - N = 100, K = 126733364, score = 0