This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
Zadanie:
Autor: Tomasz Kwiatkowski
*/
#include <bits/stdc++.h>
#include "lang.h"
#include "grader.h"
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
const int MAXN = 1e6 + 7;
const int INF = 1e9 + 7;
unordered_map<ll, int> lang[56];
//int language(int L);
void excerpt(int *E)
{
vector<int> best(56, 0);
for (int i = 2; i < 100; ++i) {
ll p = (ll)(E[i - 2] - 1)*65535*65535 + (ll)(E[i - 1] - 1)*65535 + (ll)(E[i] - 1);
for (int l = 0; l < 56; ++l)
best[l] += lang[l][p];
}
int guess = 0;
for (int i = 1; i < 56; ++i)
if (best[i] > best[guess])
guess = i;
int L = language(guess);
for (int i = 2; i < 100; ++i) {
ll p = (ll)(E[i - 2] - 1)*65535*65535 + (ll)(E[i - 1] - 1)*65535 + (ll)(E[i] - 1);
lang[L][p]++;
}
}
// #define N 100
// static char __lang[20], lan[100][20];
// static int lnum, i,j,k,n,nl, uni[N], __right, tot;
// int language(int L) {
// if (L < 0 || L >= 56) exit(92);
// __right += (L == lnum);
// tot++;
// return lnum;
// }
// int main(){
// for (n=0; 1 == scanf("%s",__lang); n++) {
// for (i=0;i<nl && strcmp(__lang,lan[i]);i++);
// strcpy(lan[i],__lang);
// if (i == nl) {
// nl++;
// }
// lnum = i;
// for (i=0;i<N;i++) scanf("%d,",&uni[i]);
// scanf("%*[^\n]");
// excerpt(uni);
// }
// printf("OK %0.2lf%%\n",100.0*__right/tot);
// return 0;
// }
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |