Submission #887711

# Submission time Handle Problem Language Result Execution time Memory
887711 2023-12-15T03:50:57 Z Faisal_Saqib Languages (IOI10_languages) C++17
100 / 100
3820 ms 142496 KB
#include <iostream>
#include "grader.h"
#include <set>
#include <map>
#include <random>
#include <vector>
using namespace std;
map<vector<int>,set<int>> wlan;
int cnt1[56];// 50
int cnt2[56];// 30
int cnt3[56];// 20
void excerpt(int *e)
{
	for(int i=0;i<=55;i++)
		cnt1[i]=cnt2[i]=cnt3[i]=0;
	for(int i=0;i<100;i++)
		for(auto j:wlan[{e[i]}])
			cnt1[j]+=30;
	for(int i=0;i<98;i++)
		for(auto j:wlan[{e[i],e[i+1],e[i+2]}])
			cnt3[j]+=25;
	for(int i=0;i<96;i++)
		for(auto j:wlan[{e[i],e[i+1],e[i+2],e[i+3],e[i+4]}])
			cnt2[j]+=50;
	int cu=0;
	for(int i=0;i<=55;i++)
		if((cnt1[i]+cnt2[i]+cnt3[i])>(cnt1[cu]+cnt2[cu]+cnt3[cu]))
			cu=i;
	cu=language(cu);
	for(int i=0;i<100;i++)
		wlan[{e[i]}].insert(cu);
	for(int i=0;i<98;i++)
		wlan[{e[i],e[i+1],e[i+2]}].insert(cu);
	for(int i=0;i<96;i++)
		wlan[{e[i],e[i+1],e[i+2],e[i+3],e[i+4]}].insert(cu);
}
# Verdict Execution time Memory Grader output
1 Correct 3778 ms 142496 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3820 ms 141620 KB Output is correct - 91.28%