题目链接:https://www.luogu.org/problemnew/show/P3393 被占领的点可以先连在一个点上然后只需要对这一个点bfs一遍就可以求所有的危险点 #include <bits/stdc++.h> #define ll long long using namespace std; const int maxn = 2 * 1e5 + 10; ll n, m, k, s, val[2], danger[maxn], ddis[maxn], dis[maxn], ch…
[luogu3393]逃离僵尸岛 luogu 先把被禁止的点和新建的虚点n+1连0边 跑最短路,dis<=s的点价格为Q,否则为P, 再建图跑最短路 #define ll long long #include<bits/stdc++.h> using namespace std; const int N=100005,M=500005; int re(){ int x=0,w=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch==…
Travel Time Limit: 10000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2789 Accepted Submission(s): 939 Problem Description One day, Tom traveled to a country named BGM. BGM is a small country, but th…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1548 A strange lift Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21754 Accepted Submission(s): 7969 Problem Description There is a strange li…
After going through the receipts from your car trip through Europe this summer, you realised that the gas prices varied between the cities you visited. Maybe you could have saved some money if you were a bit more clever about where you filled your fu…