Problem Statement Wolf Sothe and Cat Snuke are playing a card game. The game is played with exactly 100 cards. The cards are numbered from 1 to 100. The game is played as follows: First, Cat Snuke chooses the goal: an integer N between 1 and 100…
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…
problem1 link 二分答案,然后计算总时间.跟$T$比较确定要增大答案还是减小答案. problem2 link 可以看作是以‘*’所在位置为根的树.所以每个非根节点都有一个父节点. 那么每个非根结点$x$都可以表示其根结点$y$的函数,,类型为$x=p+qy$.比如说有三个节点$x,y,z$,$y$是$x$的父节点,$z$是$y$的父节点,那么有$x=1+y,y=1+\frac{1}{2}(x+z)=1+\frac{1}{2}(1+y+z)\rightarrow y=3+z$.也就是…