# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
132144 | stefdasca | Uzastopni (COCI15_uzastopni) | C++14 | 105 ms | 25720 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>
using namespace std;
int n, val[10002];
vector<int> v[10002], q[112];
bitset<112>s[10002][112];
vector<pair<int, int> >r[10002];
void dfs(int nod)
{
for(int i = 0; i < v[nod].size(); ++i)
{
int vecin = v[nod][i];
dfs(vecin);
}
for(int i = 0; i < 101; ++i)
q[i].clear();
for(int i = 0; i < v[nod].size(); ++i)
{
int x = v[nod][i];
for(int j = 0; j < r[x].size(); ++j)
{
pair<int, int> ox = r[x][j];
q[ox.first].push_back(ox.second);
}
}
for(int i = 102; i >= 1; --i)
{
if(i == val[nod])
{
s[nod][i] |= s[nod][i + 1];
s[nod][i].set(i);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |