QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#652097#7878. Matrix DistancesZhangYiDeCompile Error//C++981.1kb2024-10-18 18:19:572024-10-18 18:20:07

Details

answer.code: In function ‘int main()’:
answer.code:21:34: error: ‘>>’ should be ‘> >’ within a nested template argument list
   21 |     map<int, vector<pair<int, int>>> color_map;
      |                                  ^~
      |                                  > >
answer.code:27:30: error: ‘std::map<int, std::vector<std::pair<int, int> > >::mapped_type’ {aka ‘class std::vector<std::pair<int, int> >’} has no member named ‘emplace_back’
   27 |             color_map[color].emplace_back(i, j);
      |                              ^~~~~~~~~~~~
answer.code:33:22: error: ISO C++ forbids declaration of ‘entry’ with no type [-fpermissive]
   33 |     for (const auto& entry : color_map) {
      |                      ^~~~~
answer.code:33:30: warning: range-based ‘for’ loops only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   33 |     for (const auto& entry : color_map) {
      |                              ^~~~~~~~~
answer.code:33:30: error: forming reference to reference type ‘std::map<int, std::vector<std::pair<int, int> > >&’
answer.code:34:35: error: ‘>>’ should be ‘> >’ within a nested template argument list
   34 |         const vector<pair<int, int>>& coords = entry.second;
      |                                   ^~
      |                                   > >
answer.code:34:54: error: request for member ‘second’ in ‘entry’, which is of non-class type ‘const int’
   34 |         const vector<pair<int, int>>& coords = entry.second;
      |                                                      ^~~~~~
answer.code:37:26: error: ISO C++ forbids declaration of ‘coord’ with no type [-fpermissive]
   37 |         for (const auto& coord : coords) {
      |                          ^~~~~
answer.code:37:34: warning: range-based ‘for’ loops only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   37 |         for (const auto& coord : coords) {
      |                                  ^~~~~~
answer.code:37:34: error: forming reference to reference type ‘const std::vector<std::pair<int, int> >&’
answer.code:38:34: error: request for member ‘first’ in ‘coord’, which is of non-class type ‘const int’
   38 |             rows.push_back(coord.first);
      |                                  ^~~~~
answer.code:39:34: error: request for member ‘second’ in ‘coord’, which is of non-class type ‘const int’
   39 |             cols.push_back(coord.second);
      |                                  ^~~~~~