Submission #116228

#TimeUsernameProblemLanguageResultExecution timeMemory
116228emilemTreasure (different grader from official contest) (CEOI13_treasure2)C++14
Compilation error
0 ms0 KiB
#include "treasure.h"
#include <vector>

void FindTreasure(int n)
{
	std::vector< std::vector<int> > pref(n + 1, std::vector<int>(n + 1, 0));
	for (size_t i = 1; i <= n; ++i)
		for (size_t j = 1; j <= n; ++j)
			pref[i][j] = CountTreasure(1, 1, i, j);
	for (size_t i = 1; i <= n; ++i)
		for (size_t j = 1; j <= n; ++j)
			if (pref[i][j] - pref[i - 1][j] - pref[i][j - 1] + pref[i - 1][j - 1])
				Report(i, j);
}

Compilation message (stderr)

treasure.cpp: In function 'void FindTreasure(int)':
treasure.cpp:7:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (size_t i = 1; i <= n; ++i)
                     ~~^~~~
treasure.cpp:8:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (size_t j = 1; j <= n; ++j)
                      ~~^~~~
treasure.cpp:9:17: error: 'CountTreasure' was not declared in this scope
    pref[i][j] = CountTreasure(1, 1, i, j);
                 ^~~~~~~~~~~~~
treasure.cpp:9:17: note: suggested alternative: 'countTreasure'
    pref[i][j] = CountTreasure(1, 1, i, j);
                 ^~~~~~~~~~~~~
                 countTreasure
treasure.cpp:10:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (size_t i = 1; i <= n; ++i)
                     ~~^~~~
treasure.cpp:11:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (size_t j = 1; j <= n; ++j)
                      ~~^~~~