Submission #1080786

# Submission time Handle Problem Language Result Execution time Memory
1080786 2024-08-29T14:19:03 Z PenguinsAreCute Languages (IOI10_languages) C++17
0 / 100
10000 ms 19712 KB
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
using ld = long double;
#define all(v) begin(v),end(v)
mt19937 rng(1210);
int freq[60][1<<16];
void excerpt(int *E) {
	for(int i=0;i<60;i++) fill(freq[i]+1,freq[i]+(1<<16),1), freq[i][0]=40000;
	pair<ld,int> bst={-1e9,0};
	for(int i=0;i<56;i++) {
		ld prob = 0;
		for(int j=0;j<100;j++) prob += log(freq[i][E[j]])-log(freq[i][E[0]]);
		bst=max(bst,{prob,i});
	}
	int lang = language(bst.second);
	for(int i=0;i<100;i++) freq[lang][E[i]]++;
	freq[lang][0]+=100;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 10062 ms 19712 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 10096 ms 19692 KB Time limit exceeded
2 Halted 0 ms 0 KB -