上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 56 下一页
摘要: 先跑一遍spfa,这样就排除了小于k条边的情况。枚举那k条边中最小的边权,然后让所有的边都减去它,接着跑spfa,然后在加上k*v[i] #include <iostream> #include <cstdio> #include <queue> #include <algorithm> #incl 阅读全文
posted @ 2020-03-25 21:24 WeiAR 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 让最大值走得最多就好了,让最大值走最长链的长度,然后把最长链上的点都打上标记,再从所有没有被标记的点里找次长链,让次大值跑这个题我最后一小时写慌了,思路乱了,队友写得很妙,tql #include <iostream> #include <cstdio> #include <queue> #incl 阅读全文
posted @ 2020-03-25 20:28 WeiAR 阅读(377) 评论(0) 推荐(0) 编辑
摘要: zsh终端配置环境变量:commend not found之类的问题,去找相应的bin文件夹里的可执行程序zsh的环境变量都在/etc里的zshrc里面,把类似下面的语句加到zshrc里就大功告成啦哦,不要忘记source ~/.zshrcexport PATH=/Users/war/Library 阅读全文
posted @ 2020-03-24 14:38 WeiAR 阅读(10712) 评论(0) 推荐(0) 编辑
摘要: 这个是正确路径 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ 阅读全文
posted @ 2020-03-23 20:16 WeiAR 阅读(860) 评论(0) 推荐(0) 编辑
摘要: //转载自https://www.jianshu.com/p/c51a21503c0c,侵删 pandas作为python在数据科学领域关键包之一,熟练其API是必备的 我们使用如下缩写: df:任意的Pandas DataFrame对象 s:任意的Pandas Series对象 同时我们需要做如下 阅读全文
posted @ 2020-03-23 18:29 WeiAR 阅读(1305) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/contest/1301/problem/B如果填的这个数特别大,显然不优,如果数特别小,也不优,所以它是凸函数,可以二分(整数单峰函数二分模板题 #include <iostream> #include <cstdio> #include <queue 阅读全文
posted @ 2020-03-20 15:45 WeiAR 阅读(258) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/problemset/problem/1304/E用lca求树上距离只有3种情况a->ba->x+x->y+y->ba->y+y->x+x->b因为距离过长就可以来回走,所以k-len得是偶数 #include <iostream> #include < 阅读全文
posted @ 2020-03-20 14:27 WeiAR 阅读(357) 评论(0) 推荐(0) 编辑
摘要: int find(int x){ int temp=x; while(temp!=d[temp]) temp=d[temp]; while(x!=d[x]){ x=d[x]; d[x]=temp; } return temp; } 阅读全文
posted @ 2020-03-19 19:39 WeiAR 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 二分答案出最小距离,dpcheck,单调队列优化dp #include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #define inf 阅读全文
posted @ 2020-03-19 19:34 WeiAR 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Gym - 100712H tarjan无向图缩点+树上直径 #include<iostream> #include<cstdio> #include<queue> #include<algorithm> #include<cmath> #include<ctime> #include<set> # 阅读全文
posted @ 2020-03-11 22:59 WeiAR 阅读(180) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 56 下一页