This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "grader.h"
#define maxl 56
#define maxc 100
#define maxt 65536
#define pb push_back
using namespace std;
int cnt[maxl][maxt];
void excerpt(int tokens[maxc]) {
int score[maxl];
memset(score,0,sizeof(score));
for( int i = 0 ; i < maxc ; i++ )
for( int l = 0 ; l < maxl ; l++ )
score[l] += cnt[l][tokens[i]];
int bestScore = -1;
vector<int> candidates;
for( int l = 0 ; l < maxl ; l++ )
if(score[l] > bestScore) {
bestScore = score[l];
candidates.clear();
candidates.pb(l);
}
else if(score[l] == bestScore)
candidates.pb(l);
int sz = candidates.size();
srand(time(NULL));
int l = candidates[rand()%sz];
l = language(l);
for( int i = 0 ; i < maxc ; i++ )
cnt[l][tokens[i]]++;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |