Submission #512726

#TimeUsernameProblemLanguageResultExecution timeMemory
512726algorithm16Languages (IOI10_languages)C++14
Compilation error
0 ms0 KiB
#include<iostream> #include<algorithm> #include "grader.h" #include "lang.h" using namespace std; typedef long long int llint; set <llint> s[65],s1; llint e[105]; void excerpt(int *E) { s1.clear(); for(int i=0;i<100;i++) { e[i]=E[i]; s1.insert(e[i]); if(i && (i%2 || i>45)) s1.insert(e[i-1]*1e5+e[i]); if(i>1 && (i%2==0 || i>75)) s1.insert(e[i-2]*1e10+e[i-1]*1e5+e[i]); } int mx=0,idx=0; for(int i=0;i<56;i++) { if(s[i].size()<=mx) continue; int cnt=0; for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) { cnt+=(s[i].find(*it)!=s[i].end()); } if(cnt>mx) { mx=cnt; idx=i; } } int l=language(idx); for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) { s[l].insert(*it); } }

Compilation message (stderr)

lang.cpp:7:1: error: 'set' does not name a type
    7 | set <llint> s[65],s1;
      | ^~~
lang.cpp: In function 'void excerpt(int*)':
lang.cpp:10:2: error: 's1' was not declared in this scope
   10 |  s1.clear();
      |  ^~
lang.cpp:19:6: error: 's' was not declared in this scope
   19 |   if(s[i].size()<=mx) continue;
      |      ^
lang.cpp:21:7: error: 'set' was not declared in this scope
   21 |   for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) {
      |       ^~~
lang.cpp:5:1: note: 'std::set' is defined in header '<set>'; did you forget to '#include <set>'?
    4 | #include "lang.h"
  +++ |+#include <set>
    5 | using namespace std;
lang.cpp:21:17: error: expected primary-expression before '>' token
   21 |   for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) {
      |                 ^
lang.cpp:21:29: error: missing template arguments before 'it'
   21 |   for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) {
      |                             ^~
lang.cpp:21:43: error: 'it' was not declared in this scope; did you mean 'i'?
   21 |   for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) {
      |                                           ^~
      |                                           i
lang.cpp:22:10: error: 's' was not declared in this scope
   22 |    cnt+=(s[i].find(*it)!=s[i].end());
      |          ^
lang.cpp:30:6: error: 'set' was not declared in this scope
   30 |  for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) {
      |      ^~~
lang.cpp:30:6: note: 'std::set' is defined in header '<set>'; did you forget to '#include <set>'?
lang.cpp:30:16: error: expected primary-expression before '>' token
   30 |  for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) {
      |                ^
lang.cpp:30:28: error: missing template arguments before 'it'
   30 |  for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) {
      |                            ^~
lang.cpp:30:42: error: 'it' was not declared in this scope; did you mean 'int'?
   30 |  for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) {
      |                                          ^~
      |                                          int
lang.cpp:31:3: error: 's' was not declared in this scope
   31 |   s[l].insert(*it);
      |   ^