题意 [题目链接]这怎么发链接啊..... Sol 枚举一个断点,然后类似于LIS一样dp一波 这个边界条件有点迷啊..fst了两遍... #include<bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 10, INF = 1e9 + 7; inline int read() { char c = getchar(); int x = 0, f = 1; while(c < '0' || c > '9') {i…
Problem Statement You are a genealogist specializing in family trees of vampires. Vampire family trees differ from human family trees. In particular, vampires are "born" in a different way. The only way to create a new vampire is that an ex…
A 裸最短路. class TravelOnMars { public: int minTimes(vector <int>, int, int); }; vector<int> e[maxn]; int n; int dist(int a,int b) { if (a>b) swap(a,b); int res = min( b-a , a+n-b); return res; } int d[maxn],inq[maxn]; queue<int> q; int…
Problem Statement Cat Noku has just finished writing his first computer program. Noku's computer has m memory cells. The cells have addresses 0 through m-1. Noku's program consists of n instructions. The instructions have mutually independent ef…