Submission #155316

# Submission time Handle Problem Language Result Execution time Memory
155316 2019-09-27T14:16:56 Z jhnah917 Languages (IOI10_languages) C++14
0 / 100
3865 ms 262148 KB
#include "grader.h"
#include "lang.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int n = 100, m = 56;

/*
map<ll, int> cnt[56];
map<ll, int> cnt2[56];
map<ll, int> cnt3[56];
*/
unordered_map<ll, int> cnt4[66];

ll f(ll a, ll b){
	return (a << 16) | b;
}

ll f(ll a, ll b, ll c){
	return (a << 32) | (b << 16) | c;
}

ll f(ll a, ll b, ll c, ll d){
	return (a << 48) | (b << 32) | (c << 16) | d;
}

void excerpt(int *arr){
	int mx = 0, idx = 0;
	for(int i=0; i<m; i++){
		int now = 0;
		for(int j=0; j<n; j++){
			/*
			now += cnt[i][arr[j]];
			if(j == n-1) continue;
			now += cnt2[i][f(arr[j], arr[j+1])];
			if(j == n-2) continue;
			now += cnt3[i][f(arr[j], arr[j+1], arr[j+2])];
			*/
			if(j >= n-3) continue;
			now += cnt4[i][f(arr[j], arr[j+1], arr[j+2], arr[j+3])];
		}
		if(now > mx){
			mx = now; idx = i;
		}
	}
	
	int ans = language(idx);
	for(int i=0; i<n; i++){
		/*
		cnt[ans][arr[i]] = 1;
		if(i == n-1) continue;
		cnt2[ans][f(arr[i], arr[i+1])] = 1;
		if(i == n-2) continue;
		cnt3[ans][f(arr[i], arr[i+1], arr[i+2])] = 1;
		*/
		if(i >= n-3) continue;
		cnt4[ans][f(arr[i], arr[i+1], arr[i+2], arr[i+3])] = 1;
	}
}
# Verdict Execution time Memory Grader output
1 Runtime error 3865 ms 262144 KB Execution killed with signal 9 (could be triggered by violating memory limits)
# Verdict Execution time Memory Grader output
1 Runtime error 3663 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)