Submission #44985

# Submission time Handle Problem Language Result Execution time Memory
44985 2018-04-10T09:40:18 Z junodeveloper Languages (IOI10_languages) C++14
95 / 100
1216 ms 20136 KB
#include "lang.h"
#include "grader.h"
#include <map>
#include <algorithm>
using namespace std;
typedef unsigned long long ll;
map<ll, int> mp;
ll cnt[56] = {0};
void excerpt(int* a) {
	for(int i=0; i<56; i++) cnt[i] = 0;
	for(int i=0; i<97; i++) {
		ll val = 0;
		for(int j=0; j<4; j++)
			val = val * 65535 + a[i+j] - 1;
		if(mp.count(val)) cnt[mp[val]]++;
	}
	int ret = max_element(cnt, cnt+56) - cnt;
	int ans = language(ret);
	for(int i=0; i<97; i++) {
		ll val = 0;
		for(int j=0; j<4; j++)
			val = val * 65535 + a[i+j] - 1;
		mp[val] = ans;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1216 ms 20136 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 1115 ms 20060 KB Output is partially correct - 86.70%