Submission #39634

# Submission time Handle Problem Language Result Execution time Memory
39634 2018-01-16T19:48:12 Z baactree Languages (IOI10_languages) C++14
100 / 100
5750 ms 24696 KB
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "grader.h"
#include "lang.h"
#include <iostream>
#include <unordered_map>
using namespace std;
#define SZ 100
typedef long long ll;
int cnt[1 << 6][1 << 16];
unordered_map<ll,int> hcnt[1 << 6];
int vote[1 << 6];
void excerpt(int *E) {

	for (int i = 0; i < 56; i++){
		vote[i] = 0;
		for (int j = 0; j < SZ; j++){
			if (cnt[i][E[j]])
				vote[i]++;
			if (j > 2){
				ll h = E[j] + ((ll)E[j - 1] << 16) + ((ll)E[j - 2] << 32) + ((ll)E[j - 3] << 48);
				if (hcnt[i].count(h))
					vote[i]++;
			}
		}
	}


	int mm = 0;
	int ans = 0;
	for (int i = 0; i < 56; i++){
		if (mm < vote[i]){
			mm = vote[i];
			ans = i;
		}
	}


	int now;
	now = language(ans);

	for (int i = 0; i < SZ; i++){
		cnt[now][E[i]]++;
		if (i > 2){
			ll h = E[i] + ((ll)E[i - 1] << 16) + ((ll)E[i - 2] << 32) + ((ll)E[i - 3] << 48);
			hcnt[now][h]++;
		}
	}

}
# Verdict Execution time Memory Grader output
1 Correct 5750 ms 24696 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4948 ms 24632 KB Output is correct - 91.09%