Submission #357631

# Submission time Handle Problem Language Result Execution time Memory
357631 2021-01-24T09:22:34 Z Mefarnis Languages (IOI10_languages) C++14
0 / 100
10000 ms 27536 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;
typedef pair<pi,pi> pii;

map<pii,bool> mp[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-4 ; i++ ) {
			pi p1 = pi(tokens[i],tokens[i+1]);
			pi p2 = pi(tokens[i+2],tokens[i+3]);
			pii p = pii(p1,p2);
			score[l] += mp[l].count(p);
		}
	}	
	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-4 ; i++ ) {
		pi p1 = pi(tokens[i],tokens[i+1]);
		pi p2 = pi(tokens[i+2],tokens[i+3]);
		pii p = pii(p1,p2);
		mp[l][p] = true;
	}
}
# Verdict Execution time Memory Grader output
1 Execution timed out 10015 ms 27536 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 10069 ms 26952 KB Time limit exceeded