#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]] > 0);
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 |
1 |
Correct |
356 ms |
2924 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
366 ms |
2984 KB |
Output is partially correct - 51.49% |