Submission #887468

# Submission time Handle Problem Language Result Execution time Memory
887468 2023-12-14T15:12:50 Z Faisal_Saqib Languages (IOI10_languages) C++17
99 / 100
5800 ms 113564 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];
int cnt2[56];
int cnt3[56];
int cnt4[56];
void excerpt(int *e)
{
	for(int i=0;i<=55;i++)
		cnt1[i]=cnt2[i]=cnt3[i]=cnt4[i]=0;
	for(int i=0;i<100;i++)
		for(auto j:wlan[{e[i]}])
			cnt1[j]+=10;
	for(int i=0;i<99;i++)
		for(auto j:wlan[{e[i],e[i+1]}])
			cnt2[j]+=20;
	for(int i=0;i<98;i++)
		for(auto j:wlan[{e[i],e[i+1],e[i+2]}])
			cnt3[j]+=40;
	for(int i=0;i<97;i++)
		for(auto j:wlan[{e[i],e[i+1],e[i+2],e[i+3]}])
			cnt4[j]+=50;
	int cu=0;
	for(int i=0;i<=55;i++)
		if((cnt1[i]+cnt2[i]+cnt3[i]+cnt4[i])>(cnt1[cu]+cnt2[cu]+cnt3[cu]+cnt4[cu]))
			cu=i;
	cu=language(cu);
	for(int i=0;i<100;i++)
		wlan[{e[i]}].insert(cu);
	for(int i=0;i<99;i++)
		wlan[{e[i],e[i+1]}].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<97;i++)
		wlan[{e[i],e[i+1],e[i+2],e[i+3]}].insert(cu);
}
# Verdict Execution time Memory Grader output
1 Correct 5800 ms 113388 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 5792 ms 113564 KB Output is partially correct - 90.34%