# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
311223 | Vladikus004 | Lampice (COCI19_lampice) | C++14 | 196 ms | 75384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define inf 2e9
#define pb push_back
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair <int, int> pii;
const int N = 50000 + 3, P = 31;
int n;
vector <int> v[N];
string s;
ull h[3002][3002];
int dst[3002][3002];
ull hs[N], deg[N];
ull rhs[N], rdeg[N];
void dfs(int st, int x, int pr){
if (x == st) h[x][x] = s[x] - 'a' + 1, dst[x][x] = 0;
for (auto u: v[x]){
if (u == pr) continue;
dst[st][u] = dst[st][x] + 1;
h[st][u] = h[st][x] * P + (s[u] - 'a' + 1);
dfs(st, u, x);
}
}
void solve1(){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |