Submission #471075

# Submission time Handle Problem Language Result Execution time Memory
471075 2021-09-07T02:39:04 Z chointae Treasure (different grader from official contest) (CEOI13_treasure2) C
Compilation error
0 ms 0 KB
#include "treasure.h"

void findTreasure (int N) {
	int MAXN = 101;
	int reportlist[MAXN * MAXN][2];
	int index = 0;
	
	int total = countTreasure(1, 1, N, N);
	
	// 세로
	for (int c = N - 1; c > 0; c--) {
		int cnt = countTresure(1, 1, N, c);
		int find = total - cnt;
		total = total - find;
		
		for (int i = 1; i <= N; i++) {
			if (countTreasure(1, 1, i, c)) {
				reportlist[index][0] = i; reportlist[index][1] = c;
				index++; find--;
				if (find == 0) break;
			}
		}
		if (total == 0) break;
	}
	for (int i = 0; i < index; i++) Report(reportlist[i][0], reportlis[i][1]);
}

Compilation message

grader.c: In function 'main':
grader.c:63:19: error: expected expression before 'int'
   63 |         my_assert(int(strlen(A[i]+1)) == N, "each line of the map must contain N zeroes or ones (before loop)");
      |                   ^~~
grader.c:63:9: error: too few arguments to function 'my_assert'
   63 |         my_assert(int(strlen(A[i]+1)) == N, "each line of the map must contain N zeroes or ones (before loop)");
      |         ^~~~~~~~~
grader.c:18:6: note: declared here
   18 | void my_assert (int a, const char* s) {
      |      ^~~~~~~~~
treasure.c: In function 'findTreasure':
treasure.c:12:13: warning: implicit declaration of function 'countTresure'; did you mean 'countTreasure'? [-Wimplicit-function-declaration]
   12 |   int cnt = countTresure(1, 1, N, c);
      |             ^~~~~~~~~~~~
      |             countTreasure
treasure.c:25:59: error: 'reportlis' undeclared (first use in this function); did you mean 'reportlist'?
   25 |  for (int i = 0; i < index; i++) Report(reportlist[i][0], reportlis[i][1]);
      |                                                           ^~~~~~~~~
      |                                                           reportlist
treasure.c:25:59: note: each undeclared identifier is reported only once for each function it appears in