1106 Lowest Price in Supply Chain (25分) A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in mo ...
分类:
其他好文 时间:
2020-01-30 09:30:45
阅读次数:
95
状态不好考的不行(x 还是在家里不够专注吧(? T1 一个简单的离散化+bfs 细节不少 一个区间直接把两个端点都离散进去就行了。 统计答案的时候按块统计答案。 T2 减枝的搜索。 不是特别难。 发现其实格子并不是很多。 被$K$给限制住了。 太多的都是0. 那么$n+m 1$的大小必然是小于等于1 ...
分类:
其他好文 时间:
2020-01-29 19:39:11
阅读次数:
59
#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int maxn = 110; struct Node{ int data; int ...
分类:
其他好文 时间:
2020-01-29 16:18:25
阅读次数:
84
#include<iostream> #include<algorithm> using namespace std; const int N=1e6+10; struct edge{ int a,b; double w; }e[N]; int p[N]; int a[N]; int n; bool ...
分类:
Web程序 时间:
2020-01-29 14:15:19
阅读次数:
66
题目链接:https://vjudge.net/problem/POJ-3436 Sample input 1 3 4 15 0 0 0 0 1 0 10 0 0 0 0 1 1 30 0 1 2 1 1 1 3 0 2 1 1 1 1 题目:P —— 一台电脑由p个零件组成 N —— 工厂有n台加 ...
分类:
其他好文 时间:
2020-01-28 20:56:06
阅读次数:
82
https://codeforces.com/contest/1283/problem/D 题意:在一条无限长的坐标轴上,给你n颗树,m个人。求所有人到树的最短距离的总和和坐标。 解法:多源bfs,map标记。 //#include <bits/stdc++.h> #include <cstdio> ...
分类:
其他好文 时间:
2020-01-28 14:09:52
阅读次数:
60
给出一张地图,这张地图被分为n×m(n,m<=100)个方块,任何一个方块不是平地就是高山。平地可以通过,高山则不能。现在你处在地图的(x1,y1)这块平地,问:你至少需要走几个空地才能到达目的地(x2,y2)?你只能沿着水平和垂直方向的平地上行进。,还可以自行打印路径在这里插入图片描述Input第 ...
分类:
其他好文 时间:
2020-01-28 00:07:17
阅读次数:
117
#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int MAXN = 110; struct Node{ int weight; v ...
分类:
其他好文 时间:
2020-01-27 23:53:49
阅读次数:
89
#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int maxn = 100010; struct node{ //bool lea ...
分类:
其他好文 时间:
2020-01-27 23:31:00
阅读次数:
89
定义: 直径 : 在圆上两点(不相交)之间最远的距离就是我们通常所说的直径。 树的直径 : 树上最远的两个节点之间的距离就被称为树的直径,连接这两点的路径被称为树的最长链。 求法: 1、树形 DP 2、两次 BFS 或者 两次 DFS 算法 1 : 树形 DP 优点 : 可以有效处理 负边权 缺点 ...
分类:
其他好文 时间:
2020-01-27 19:32:04
阅读次数:
117