# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
258882 | easrui | Village (BOI20_village) | C++14 | 112 ms | 14072 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 va first
#define vb second
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef pair<int,pii> pip;
const int MN = 1e5+5;
const int MOD = 1e9+7;
const int INF = 1e9;
ll sz[MN],N,min_ans,max_ans,cnt;
int pos[MN],ord[MN],vmin[MN],vmax[MN];
vector<int> G[MN];
bool vis[MN],done[MN];
void dfs(int s)
{
vis[s] = 1;
sz[s] = 1;
for(int e:G[s]){
if(vis[e]) continue;
dfs(e);
sz[s] += sz[e];
if(done[e]) continue;
else{
done[s] = 1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |