Submission #512698

#TimeUsernameProblemLanguageResultExecution timeMemory
512698algorithm16Languages (IOI10_languages)C++14
0 / 100
1 ms460 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; int cnt[70005]; int cmp(int i) { int ret=0; for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) { cnt[(*it)]+=1; } for(set <llint>::iterator it=s[i].begin();it!=s[i].end();it++) { if(cnt[(*it)]) ret+=1; } for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) { cnt[(*it)]-=1; } return ret; } void excerpt(int *E) { s1.clear(); for(int i=0;i<100;i++) { s1.insert(E[i]); if(i) s1.insert(E[i-1]*1e5+E[i]); if(i>1) 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 cnt1=cmp(i); if(cnt1>mx) { mx=cnt1; 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: In function 'void excerpt(int*)':
lang.cpp:32:17: warning: comparison of integer expressions of different signedness: 'std::set<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   32 |   if(s[i].size()<=mx) continue;
      |      ~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...