#include "grader.h"
#include "lang.h"
#include <bits/stdc++.h>
using namespace std;
const int n = 100, m = 56;
const int mod = 1e5+3, base = 917;
int cnt[66][101010];
int cnt2[66][101010];
int cnt3[66][101010];
int cnt4[66][101010];
int f(int a, int b){
int ret = a;
ret = (ret * base + b) % mod;
return ret;
}
int f(int a, int b, int c){
int ret = a;
ret = (ret * base + b) % mod;
ret = (ret * base + c) % mod;
return ret;
}
int f(int a, int b, int c, int d){
int ret = a;
ret = (ret * base + b) % mod;
ret = (ret * base + c) % mod;
ret = (ret * base + d) % mod;
return ret;
}
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++){
if(cnt[i][arr[j]]) now++;
if(j == n-1) break;
if(cnt[i][f(arr[j], arr[j+1])]) now++;
if(j == n-2) break;
if(cnt[i][f(arr[j], arr[j+1], arr[j+2])]) now++;
if(j == n-3) break;
if(cnt[i][f(arr[j], arr[j+1], arr[j+2], arr[j+3])]) now++;
}
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;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3749 ms |
22540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
3217 ms |
22648 KB |
Output is partially correct - 89.68% |