Submission #512734

#TimeUsernameProblemLanguageResultExecution timeMemory
512734Markomafko972Languages (IOI10_languages)C++14
Compilation error
0 ms0 KiB
#include <stdlib.h> #include <stdio.h> #include "grader.h" #include "lang.h" map<int, int> m[60]; set<int> s; vector<int> v; void excerpt(int *E) { s.clear(); v.clear(); for (int i = 0; i < 100; i++) s.insert(E[i]); for (set<int> :: iterator it = s.begin(); it != s.end(); it++) v.push_back(*it); int maxi = -1, koji = 0; for (int i = 0; i < 56; i++) { int kol = 0; for (int j = 0; j < v.size(); j++) { if (m[i][v[j]] > 0) kol++; } if (kol > maxi) { maxi = kol; koji = i; } } int pravi = language(koji); for (int i = 0; i < v.size(); i++) m[pravi][v[i]]++; }

Compilation message (stderr)

lang.cpp:7:1: error: 'map' does not name a type
    7 | map<int, int> m[60];
      | ^~~
lang.cpp:8:1: error: 'set' does not name a type
    8 | set<int> s;
      | ^~~
lang.cpp:9:1: error: 'vector' does not name a type
    9 | vector<int> v;
      | ^~~~~~
lang.cpp: In function 'void excerpt(int*)':
lang.cpp:12:5: error: 's' was not declared in this scope
   12 |     s.clear();
      |     ^
lang.cpp:13:5: error: 'v' was not declared in this scope
   13 |     v.clear();
      |     ^
lang.cpp:15:10: error: 'set' was not declared in this scope
   15 |     for (set<int> :: iterator it = s.begin(); it != s.end(); it++) v.push_back(*it);
      |          ^~~
lang.cpp:15:14: error: expected primary-expression before 'int'
   15 |     for (set<int> :: iterator it = s.begin(); it != s.end(); it++) v.push_back(*it);
      |              ^~~
lang.cpp:15:47: error: 'it' was not declared in this scope; did you mean 'int'?
   15 |     for (set<int> :: iterator it = s.begin(); it != s.end(); it++) v.push_back(*it);
      |                                               ^~
      |                                               int
lang.cpp:21:17: error: 'm' was not declared in this scope
   21 |             if (m[i][v[j]] > 0) kol++;
      |                 ^
lang.cpp:31:40: error: 'm' was not declared in this scope
   31 |     for (int i = 0; i < v.size(); i++) m[pravi][v[i]]++;
      |                                        ^