# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
155313 | jhnah917 | Languages (IOI10_languages) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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) continue;
now += cnt[i][f(arr[j], arr[j+1])];
if(j == n-2) continue;
now += cnt[i][f(arr[j], arr[j+1], arr[j+2])];
*/
if(j == n-3) continue;
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) continue;
cnt[ans][f(arr[i], arr[i+1])] = 1;
if(i == n-2) continue;
cnt[ans][f(arr[i], arr[i+1], arr[i+2])] = 1;
*/
if(i == n-3) continue;
cnt[ans][f(arr[i], arr[i+1], arr[i+2], arr[i+3])] = 1;
}
}