Submission #512783

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

Compilation message (stderr)

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:27:2: error: expected unqualified-id before 'int'
   27 |  int idx=0;
      |  ^~~
lang.cpp:37:4: error: 'idx' was not declared in this scope
   37 |    idx=i;
      |    ^~~
lang.cpp:40:17: error: 'idx' was not declared in this scope
   40 |  int l=language(idx);
      |                 ^~~