mym

【NOIP2012】开车旅行

匿名 (未验证) 提交于 2019-12-02 23:56:01
题面 https://www.luogu.org/problem/P1081 题解 // luogu-judger-enable-o2 #include<iostream> #include<cstdio> #include<set> #include<algorithm> #include<vector> #include<cstdlib> #include<cassert> using namespace std; const long long INF=100000000000LL; struct city{ int num; long long h; bool operator < (const city rhs) const { return h<rhs.h; } }; set<city> s; vector <int> son[205000]; int fa[205000],f[205000][20],n,m,p; long long h[105000],sum1[205000],sum2[205000],sum0[205000],x0; bool vis[205000]; double val; long long abq(long long x){ if (x>=0) return x; else return -x; } bool smaller(int x

【NOIP2012】开车旅行

给你一囗甜甜゛ 提交于 2019-11-28 20:56:28
题面 https://www.luogu.org/problem/P1081 题解 // luogu-judger-enable-o2 #include<iostream> #include<cstdio> #include<set> #include<algorithm> #include<vector> #include<cstdlib> #include<cassert> using namespace std; const long long INF=100000000000LL; struct city{ int num; long long h; bool operator < (const city rhs) const { return h<rhs.h; } }; set<city> s; vector <int> son[205000]; int fa[205000],f[205000][20],n,m,p; long long h[105000],sum1[205000],sum2[205000],sum0[205000],x0; bool vis[205000]; double val; long long abq(long long x){ if (x>=0) return x; else return -x; } bool smaller(int x