#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];
map<ll, int> cnt4[56];
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) break;
now += cnt[i][f(arr[j], arr[j+1])];
if(j == n-2) break;
now += cnt[i][f(arr[j], arr[j+1], arr[j+2])];
if(j == n-3) break;
now += cnt[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) break;
cnt[ans][f(arr[i], arr[i+1])] = 1;
if(i == n-2) break;
cnt[ans][f(arr[i], arr[i+1], arr[i+2])] = 1;
if(i == n-3) break;
cnt[ans][f(arr[i], arr[i+1], arr[i+2], arr[i+3])] = 1;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
3576 ms |
262148 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
3484 ms |
262148 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |