# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
704594 | amirhoseinfar1385 | Mousetrap (CEOI17_mousetrap) | C++17 | 850 ms | 115576 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;
const int maxn=1000000+5;
vector<int>adj[maxn],alldp[maxn];
int par[maxn],vis[maxn],n,t,m,dp[maxn],ted[maxn],mainres;
int val[maxn],high[maxn];
struct compare
{
bool operator()(const pair<int,int> & a, const pair<int,int> & b)
{
if(a.first==b.first){
return high[a.second]>high[b.second];
}
return a.first<b.first;
}
};
priority_queue<pair<int,int>,vector<pair<int,int>>,compare>pq;
void dfs(int u,int para=0){
par[u]=para;
high[u]=high[para]+1;
for(int x:adj[u])
{
if(x!=para){
dfs(x,u);
vis[u]|=vis[x];
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... |