![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
uva
fxt275307894a
这个作者很懒,什么都没留下…
展开
-
UVA11367 Full Tank?
题面传送门 二维djdjdj 考虑设di,jd_{i,j}di,j为到达iii点,还有jjj升油的最小花费。 那么可以拓展出两种状态,即加111升油或前往下一个城市。 代码实现: #include<cstdio> #include<cstring> #include<queue> using namespace std; int n,m,k,x,y,z,d[1039][139],w[1039],cur; struct yyy{int to,w,z;}tmp; struc原创 2020-08-27 22:02:26 · 146 阅读 · 0 评论 -
SP116 INTERVAL - Intervals
题面传送门 感觉就像一道裸题。 转化成前缀和然后建边即可。 注意前缀和特性:qi>qi−1&&q−qi−1≤1q_i>q_{i-1}\&\&q_-q_{i-1}\leq1qi>qi−1&&q−qi−1≤1 所以按照这个建边就好了。 代码实现: #include<cstdio> #include<cstring> #include<queue> #define max(a,b) ((a)>(b)原创 2020-07-13 21:54:32 · 86 阅读 · 0 评论 -
UVA10308 Roads in the North
题面传送门 这道题是树的直径裸题。 显然跑两遍dfsdfsdfs找树的直径即可。 但是输入很毒瘤。 所以要信仰stringstreamstringstreamstringstream啊 代码实现: #include<bits/stdc++.h> using namespace std; int n,m,k,x,y,z,ans,tot,pus,flag,maxn,maxs,flags; struct yyy {int to,w,z;}; struct ljb { int head,h[10003原创 2020-07-10 21:52:51 · 117 阅读 · 0 评论