![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
天梯赛
王文波~
清。。
展开
-
二叉搜索树的建图方式
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; const int N = 1010; int a[N]; int n; int cnt; struct Node{ Node *l; Node *r; int val; }; Node *root = NULL; Node *build(Node原创 2021-04-20 14:06:47 · 258 阅读 · 0 评论 -
L2-001 紧急救援 (25 分)
作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救援队数量和每一条连接两个城市的快速道路长度都标在地图上。当其他城市有紧急求助电话给你的时候,你的任务是带领你的救援队尽快赶往事发地,同时,一路上召集尽可能多的救援队。 输入格式: 输入第一行给出4个正整数N、M、S、D,其中N(2≤N≤500)是城市的个数,顺便假设城市的编号为0 ~ (N−1);M是快速道路的条数;S是出发地的城市编号;D是目的地的城市编号。 第二行给出N个正整数,原创 2021-03-16 16:53:37 · 217 阅读 · 0 评论