Submission #357622

# Submission time Handle Problem Language Result Execution time Memory
357622 2021-01-24T09:14:40 Z Mefarnis Languages (IOI10_languages) C++14
81 / 100
5063 ms 5048 KB
#include <bits/stdc++.h>
#include "grader.h"
#define maxl 56
#define maxc 100
#define maxt 65536
#define pb push_back
using namespace std;
typedef pair<int,int> pi;

set<pi> s[maxl];

void excerpt(int tokens[maxc]) {
	int score[maxl];
	for( int l = 0 ; l < maxl ; l++ ) {
		score[l] = 0;
		for( int i = 0 ; i < maxc-1 ; i++ ) {
			pi p = pi(tokens[i],tokens[i+1]);
			score[l] += (s[l].find(p) != s[l].end());
		}
	}	
	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-1 ; i++ ) {
		pi p = pi(tokens[i],tokens[i+1]);
		s[l].insert(p);
	}
}
# Verdict Execution time Memory Grader output
1 Correct 5063 ms 5048 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 5016 ms 4944 KB Output is partially correct - 74.43%