| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1327020 | minh30082008 | Languages (IOI10_languages) | C++20 | 0 ms | 0 KiB |
#include "grader.h"
#include<bits/stdc++.h>
#define fi first
#define se second
#define FOR(i, k, n) for(int i = k; i <= n; i++)
#define FOR1(i, k, n) for(int i = k; i >= n; i--)
#define pb push_back
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int, int>
#define vii vector<pii>
#define ll long long
#define vll vector<ll>
#define pll pair<ll, ll>
#define re return 0
#define mii map<int, int>
#define input "wtf.inp"
#define output "wtf.out"
#define rf freopen(input, "r", stdin); freopen(output, "w", stdout)
using namespace std;
const int maxn = 2e5 + 5;
const int mod = 1e9 + 19972207;
const int base = 65536;
const int base1 = 31;
const int SZ = 320;
const ll INF = 1e18;
const long double EPS = 1e-9;
void add(int &a, int b)
{
a += b;
if(a >= mod) a -= mod;
if(a < 0) a += mod;
}
mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
int randint(int l, int r)
{
return uniform_int_distribution<int>(l, r) (rd);
}
double rand(double l, double r)
{
return uniform_real_distribution<double>(l, r) (rd);
}
const int MOD = 999983;
int cnt[60][MOD];
ll val[60];
void Excerpt(int *a)
{
FOR(i, 0, 55)
val[i] = 0;
FOR(i, 0, 96)
{
FOR(k, 1, 4)
{
ll res = 0;
FOR(j, i, i + k - 1)
res = (res * base + a[j]) % MOD;
FOR(t, 0, 55)
val[t] += cnt[t][res];
}
}
int ask = 0;
FOR(i, 0, 55)
if(val[i] > val[ask])
ask = i;
int kq = language(ask);
FOR(i, 0, 96)
{
FOR(k, 1, 4)
{
ll res = 0;
FOR(j, i, i + k - 1)
res = (res * base + a[j]) % MOD;
cnt[kq][res]++;
}
}
}
