Submission #138952

#TimeUsernameProblemLanguageResultExecution timeMemory
138952baluteshihLanguages (IOI10_languages)C++14
0 / 100
2476 ms1152 KiB
#include <stdlib.h> #include <stdio.h> #include <vector> #include <map> #include <bitset> #define jizz ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); #define pb push_back #define ET cout << "\n" #define F first #define S second #define MP make_pair #define ALL(v) v.begin(),v.end() #define MEM(i,j) memset(i,j,sizeof i) #define DB(a,s,e) {for(int i=s;i<e;++i) cout << a[i] << " ";ET;} using namespace std; typedef long long ll; #include "grader.h" #include "lang.h" const int SZ=100; vector<int> ap; map<int,int> having[56]; bitset<56> vis; int cal(int x,int *E) { int rt=0; for(int i=0;i<SZ;++i) { auto p=having[x].find(E[i]); if(p!=having[x].end()) rt+=p->S; } return rt; } void excerpt(int *E) { int t; if(ap.empty()) t=language(0); else { int mx=-1; for(int i:ap) { int tmp=cal(i,E); if(tmp>mx) mx=tmp,t=i; } t=language(t); } if(!vis[t]) vis[t]=1,ap.pb(t); for(int i=0;i<SZ;++i) ++having[t][E[i]]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...