题目: 伯兰州立大学的医学部刚刚结束了招生活动.和以往一样,约80%的申请人都是女生并且她们中的大多数人将在未来4年(真希望如此)住在大学宿舍里. 宿舍楼里有nn个房间和一只老鼠!女孩们决定在一些房间里设置捕鼠器来除掉这只可怕的怪物.在ii号房间设置陷阱要花费c_ic i 伯兰币.房间编号从11到nn. 要知道老鼠不是一直原地不动的,它不停地跑来跑去.如果tt秒时它在ii号房间,那么它将在t+1t+1秒时跑到a_ia i 号房间,但这期间不会跑到别的任何房间里(i=a_ii=a i …
Mouse Hunt time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Medicine faculty of Berland State University has just finished their admission campaign. As usual, about 80%80% of applicants are…
Mouse Hunt 给定一个n个点的图,每个点有权值\(c_i\),并且只有一条出边.现在你要在一些点上打标记,使得从任何一个点出发最终都会经过有标记的点.求标记点的权值和最小值. 就是找环啊!拓扑排序啊! #include <cstdio> #include <algorithm> using namespace std; const int maxn=2e5+5; int n, c[maxn], a[maxn], in[maxn], vis[maxn]; int q[maxn…
题目描述: Mouse Hunt time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Medicine faculty of Berland State University has just finished their admission campaign. As usual, about 80%of applicants a…
Medicine faculty of Berland State University has just finished their admission campaign. As usual, about 80%80% of applicants are girls and majority of them are going to live in the university dormitory for the next 44 (hopefully) years. The dormitor…