# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
421088 | Jasiekstrz | Road Closures (APIO21_roads) | C++17 | 1907 ms | 504452 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 "roads.h"
#include<bits/stdc++.h>
#define fi first
#define se second
using namespace std;
const int NN=1e5;
const int SQ=100;
const long long INF=(long long)1e18+7;
vector<pair<int,int>> e[NN+10];
vector<pair<long long,long long>> *dp[NN+10]; // fi - parent destroyed, se - parent not destroyed
bool big(int x)
{
return e[x].size()>SQ;
}
void dfs(int x,int p,int n)
{
for(auto v:e[x])
{
if(v.fi!=p)
dfs(v.fi,x,n);
}
if(big(x))
{
dp[x]=new vector<pair<long long,long long>>(n);
vector<long long> tmp;
tmp.reserve(e[x].size());
// small k
for(int k=0;k<=min(SQ,n-1);k++)
{
tmp.clear();
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |