#include <stdlib.h>
#include <stdio.h>
#include "grader.h"
#include "lang.h"
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define sortv(v) sort(all(v))
#define uniqv(v) (v).erase(unique(all(v)), (v).end())
#define pb push_back
#define FI first
#define SE second
#define lb lower_bound
#define ub upper_bound
#define test 1
#define TEST if(test)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
const int MOD = 1000000007; // 998244353
const int INF = 2e9;
const ll INFLL = 1e18;
const int MAX_N = 10000;
#define SZ 100
#define LAN 56;
int idx = 0;
vector<ll> v[MAX_N+10];
int lan[MAX_N+10];
map<ll, pii> mp;
vector<ll> vt;
ll mx1, mx2, mx;
int c1, c2;
void check(ll x){
vt.pb(x);
}
void excerpt(int *E) {
idx++;
for(int i=0; i<SZ; i++){
ll t = (ll)E[i];
for(int j=1; j<1; j++){
if(i+j>=SZ) break;
t=(t<<16);
t = t + (ll)E[i+j];
}
check(t);
}
sort(vt.begin(), vt.end());
mx1 = mx2 = 0; c1 = c2 = 0;
while(!vt.empty()){
ll now = vt.back(); vt.pop_back();
int c = 1;
while(!vt.empty() && vt.back()==now){
vt.pop_back(); c++;
}
if(c>c1){
c2 = c1; mx2 = mx1;
c1 = c; mx1 = now;
}else if(c>c2){
c2 = c; mx2 = now;
}
}
mx = mx2;
pii p = mp[mx];
c1=c2;
int ask = lan[p.first];
lan[idx] = language(ask);
if(lan[idx]!=ask){
if(c1>p.second){
mp[mx] = {idx, c1};
}
}
//cout<<idx<<" "<<mx<<" "<<ask<<" "<<lan[idx]<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
183 ms |
632 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
203 ms |
760 KB |
Output isn't correct - 22.86% |