Submission #357620

# Submission time Handle Problem Language Result Execution time Memory
357620 2021-01-24T09:10:37 Z Mefarnis Languages (IOI10_languages) C++14
54 / 100
366 ms 2984 KB
#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%