Submission #512736

#TimeUsernameProblemLanguageResultExecution timeMemory
512736Markomafko972Languages (IOI10_languages)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #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:8:1: error: 'map' does not name a type
    8 | map<int, int> m[60];
      | ^~~
lang.cpp:9:1: error: 'set' does not name a type; did you mean 'setns'?
    9 | set<int> s;
      | ^~~
      | setns
lang.cpp:10:1: error: 'vector' does not name a type
   10 | vector<int> v;
      | ^~~~~~
lang.cpp: In function 'void excerpt(int*)':
lang.cpp:13:5: error: 's' was not declared in this scope
   13 |     s.clear();
      |     ^
lang.cpp:14:5: error: 'v' was not declared in this scope
   14 |     v.clear();
      |     ^
lang.cpp:16:10: error: 'set' was not declared in this scope; did you mean 'std::set'?
   16 |     for (set<int> :: iterator it = s.begin(); it != s.end(); it++) v.push_back(*it);
      |          ^~~
      |          std::set
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from lang.cpp:1:
/usr/include/c++/10/bits/stl_set.h:94:11: note: 'std::set' declared here
   94 |     class set
      |           ^~~
lang.cpp:16:14: error: expected primary-expression before 'int'
   16 |     for (set<int> :: iterator it = s.begin(); it != s.end(); it++) v.push_back(*it);
      |              ^~~
lang.cpp:16:47: error: 'it' was not declared in this scope; did you mean 'int'?
   16 |     for (set<int> :: iterator it = s.begin(); it != s.end(); it++) v.push_back(*it);
      |                                               ^~
      |                                               int
lang.cpp:22:17: error: 'm' was not declared in this scope
   22 |             if (m[i][v[j]] > 0) kol++;
      |                 ^
lang.cpp:32:40: error: 'm' was not declared in this scope
   32 |     for (int i = 0; i < v.size(); i++) m[pravi][v[i]]++;
      |                                        ^