摘要: Bogo Sort Problem: Today Tonnnny the monkey learned a new algorithm called Bogo Sort. The teacher gave Tonnnny the code of Bogo sort: bool is_sorted(i 阅读全文
posted @ 2020-07-27 17:11 落水清心 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 城市网络 Problem: 有一个树状的城市网络(即 n 个城市由 n-1 条道路连接的连通图),首都为 1 号城市,每个城市售卖价值为 a_i 的珠宝。 你是一个珠宝商,现在安排有 q 次行程,每次行程为从 u 号城市前往 v 号城市(走最短路径),保证 v 在 u 前往首都的最短路径上。 在每次 阅读全文
posted @ 2020-07-27 10:59 落水清心 阅读(120) 评论(0) 推荐(0) 编辑