Submission #575360

# Submission time Handle Problem Language Result Execution time Memory
575360 2022-06-10T09:13:17 Z drekavacc Languages (IOI10_languages) C++14
0 / 100
1 ms 340 KB
#include <lang.h>
#include <set>
#include <map>
#include <grader.h>
using namespace std;
int slo[60][70000];

int abs(int x){
	if(x > 0) return x;
	return -x;
}
 
void excerpt(int *a){
  	set<int> chars;
  	map<int, int> val;
  	for(int i=0; i<100; i++) chars.insert(a[i]), val[a[i]]++;
  	
  	int best = 0;
  	int mdif = 1000000;
	
	for(int l=0; l<56; l++){
		int cd = 0;
		
		for(int c : chars){
			cd += abs(val[c] - slo[l][c]);
		}
		
		if(cd < mdif){
			mdif = cd;
			best = l;
		}
		
		int correct = language(best);
		for(int c : chars){
			slo[correct][c] = (slo[correct][c] + val[c]) / 2;
		}
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 340 KB Hacked.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Hacked.
2 Halted 0 ms 0 KB -