10 2021 档案

摘要:奖金 来道拓扑排序。 #include<iostream> #include<cstdio> #include<cstring> #include<vector> #include<queue> using namespace std; const int N=1e4+5; vector<int> 阅读全文
posted @ 2021-10-31 13:47 Rekord 阅读(503) 评论(0) 推荐(0)
摘要:城市公交网建设问题 原来这叫Kruskal算法! #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N=105; struct edge{ 阅读全文
posted @ 2021-10-31 13:27 Rekord 阅读(597) 评论(0) 推荐(1)
摘要:搭配购买 并查集+01背包。 #include<iostream> #include<string> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> using namespace std; const i 阅读全文
posted @ 2021-10-31 13:04 Rekord 阅读(424) 评论(0) 推荐(0)
摘要:团伙 #include<iostream> #include<cstdio> #include<vector> #include<queue> #include<cstring> using namespace std; const int N=1005; vector<int> fri[N]; v 阅读全文
posted @ 2021-10-30 18:54 Rekord 阅读(430) 评论(0) 推荐(0)
摘要:格子游戏 二维并查集的经典模板了! #include<iostream> using namespace std; const int N=205; struct node{ int x,y; }f[N][N]; node findth(node k){ return (f[k.x][k.y].x= 阅读全文
posted @ 2021-10-30 18:28 Rekord 阅读(399) 评论(0) 推荐(0)
摘要:珍珠 #include<iostream> #include<cstring> #include<cstdio> using namespace std; #define inf 0x3f3f3f3f const int N=105; int mapp[N][N]; // int ans[N]; i 阅读全文
posted @ 2021-10-30 13:30 Rekord 阅读(785) 评论(0) 推荐(0)
摘要:刻录光盘 #include<iostream> #include<cstring> #include<cstdio> using namespace std; const int N=205; int n; int mapp[N][N]; int p[N]; int main(){ scanf("% 阅读全文
posted @ 2021-10-30 12:47 Rekord 阅读(782) 评论(0) 推荐(0)
摘要:最短路 加了自己能看懂的注释,变量名也尽量使用更贴合的单词。 #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; const int inf = 0x3f3f3f3f; 阅读全文
posted @ 2021-10-29 23:01 Rekord 阅读(510) 评论(0) 推荐(1)
摘要:城市路 注意: 两个城市之间可能有多条路。 #include<iostream> #include<cstring> #include<cmath> #define inf 0x3f3f3f3f using namespace std; const int N=2005; int mapp[N][N 阅读全文
posted @ 2021-10-27 22:55 Rekord 阅读(571) 评论(0) 推荐(0)
摘要:热浪 #include<iostream> #include<cstring> #include<cmath> #define inf 0x3f3f3f3f using namespace std; const int N=2505; int mapp[N][N],dis[N]; bool vis[ 阅读全文
posted @ 2021-10-25 23:59 Rekord 阅读(591) 评论(0) 推荐(0)
摘要:最短路径 #include<iostream> #include<cstring> #include<cmath> #define inf 0x3f3f3f3f using namespace std; const int N=105; int mapp[N][N]; int main(){ int 阅读全文
posted @ 2021-10-25 23:44 Rekord 阅读(332) 评论(0) 推荐(0)
摘要:香甜的黄油 #include<iostream> #include<cstring> #include<cmath> #define M 0x3f3f3f3f using namespace std; const int N=805; int mapp[N][N],P[N]; int main(){ 阅读全文
posted @ 2021-10-24 16:09 Rekord 阅读(435) 评论(0) 推荐(0)
摘要:最小花费 注意事项: Floyd算法复杂度过不去。 #include<iostream> #include<cstring> #include<cmath> using namespace std; const int N=2005; double mapp[N][N],c[N]; bool f[N 阅读全文
posted @ 2021-10-24 15:34 Rekord 阅读(314) 评论(0) 推荐(0)
摘要:牛的旅行 注意事项: - 枚举所有连接两个牧场的路径并找出其中的最短路径,最后别忘了跟单个牧场的直径相比较 - 用scanf("%c",&c)替换cin>>c只能拿20分,别问我为什么,我不知道(灬ꈍ ꈍ灬) #include<iostream> #include<cstring> #include 阅读全文
posted @ 2021-10-24 13:30 Rekord 阅读(391) 评论(0) 推荐(0)
摘要:最短路径问题 Floyd算法 #include<iostream> #include<cstdio> #include<cmath> #include<cstring> using namespace std; const int N=105; int a[N][2]; double d[N][N] 阅读全文
posted @ 2021-10-21 20:08 Rekord 阅读(250) 评论(0) 推荐(0)
摘要:骑马修栅栏 题解参考至shake_jake 本来想优化优化的,然后就... 提交了18次┭┮﹏┭┮(至死也没明白为什么wrong了?)。 #include<iostream> #include<algorithm> #include<cstdio> using namespace std; cons 阅读全文
posted @ 2021-10-21 19:40 Rekord 阅读(376) 评论(0) 推荐(0)
摘要:铲雪车 解题思路: 由于所有的道路都是双车道,所以整个街道所抽象出来的图必定是欧拉回路。 因为是欧拉回路,所以从任一点出发都存在_经过且只经过一次所有路径_的路径(好像有点拗口wuwu)。 另外要注意分钟的格式打印。 #include<iostream> #include<cmath> #inclu 阅读全文
posted @ 2021-10-20 00:03 Rekord 阅读(1094) 评论(0) 推荐(0)
摘要:一笔画问题 解题前置知识: 定理1:存在欧拉路的条件:图是连通的,有且只有2个奇点。 定理2:存在欧拉回路的条件:图是连通的,有0个奇点。 #include<iostream> #include<algorithm> using namespace std; const int N=1005; // 阅读全文
posted @ 2021-10-19 23:17 Rekord 阅读(586) 评论(0) 推荐(0)
摘要:ES标准的缺陷 没有模块系统 标准库较少 没有标准接口 缺乏管理系统 CommonJS对模块的定义 模块引用 在node中,通过require()函数来引入外部的模块 require()可以传递一个文件的路径作为参数,node将会自动根据该路径来引入外部模块,若使用相对路径,必须以.或..开头 使用 阅读全文
posted @ 2021-10-14 22:52 Rekord 阅读(69) 评论(0) 推荐(0)
摘要:和 绘制带箭头的直线【MFC】 or 绘制带刻度的直线【MFC】 有所不同。 虽然方法内部还是使用了CDC指针和它相关的画线方法,但是整条直线的底层是使用中点画线法实现的。 代码如下: //斜率范围为[0,1]时的中点画线法 void MidPointLine0To1(CDC *pdc, int x 阅读全文
posted @ 2021-10-09 10:35 Rekord 阅读(741) 评论(0) 推荐(0)
摘要:传送门 class Solution { public: /** * 最大数 * @param nums int整型vector * @return string字符串 */ static bool cmp(string x,string y){ return x+y>y+x; } string s 阅读全文
posted @ 2021-10-08 10:59 Rekord 阅读(93) 评论(0) 推荐(0)
摘要:传送门 class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param arr intvector * @param k int * @return int */ int foundOnceNumber 阅读全文
posted @ 2021-10-06 11:21 Rekord 阅读(46) 评论(0) 推荐(0)
摘要:按之字形顺序打印二叉树 /* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } }; */ c 阅读全文
posted @ 2021-10-02 18:51 Rekord 阅读(70) 评论(0) 推荐(0)