Submission #512748

# Submission time Handle Problem Language Result Execution time Memory
512748 2022-01-16T17:27:47 Z lovro_nidogon1 Languages (IOI10_languages) C++14
93 / 100
8524 ms 19828 KB
#include<bits/stdc++.h>
#include "lang.h"
#include "grader.h"
using namespace std;
int freq[56][70001], nocur[56], cfreq[70001], x;
const int cum = 2;
set<pair<int, int> > ses[56];
set<pair<int, pair<int, int> > > sussy[56];
void excerpt(int *e) {
	x++;
	 int exp = 0;
	 int sd = 0;
	 for(int i = 0; i < 56; i++) {
	 	 int csd = 0;	 	
		 for(int j = 0; j < 100; j++) csd += freq[i][e[j]]; 				   			
		 for(int j = 0; j < 99; j++) csd += (ses[i].find({e[j], e[j + 1]}) != ses[i].end());
		 for(int j = (x + i)%2; j < 98; j+=cum) csd += (sussy[i].find({e[j], {e[j + 1], e[j + 2]}}) != sussy[i].end());
		 if(csd > sd) sd = csd, exp = i;
	 }
	 int ca = language(exp);
	 for(int i = 0; i < 100; i++) freq[ca][e[i]] = 1;
	 for(int i = 0; i < 99; i++) ses[ca].insert({e[i], e[i + 1]});
	 for(int i = (x + exp)%2; i < 98; i+=cum) sussy[ca].insert({e[i], {e[i + 1], e[i + 2]}});
	 nocur[ca]++;
}
# Verdict Execution time Memory Grader output
1 Correct 8524 ms 19828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 8497 ms 19760 KB Output is partially correct - 85.33%