摘要: Description 给定平面上的 $n$ 个点,定义 $(x_1,y_1)$ 到 $(x_2,y_2)$ 的费用为 $\min(|x_1 x_2|,|y_1 y_2|)$ ,求从 $1$ 号点走到 $n$ 号点的最小费用。 Input 第一行包含一个正整数 $n(2\le n\le 200000 阅读全文
posted @ 2018-03-02 20:32 aziint 阅读(132) 评论(0) 推荐(0)
摘要: ```c++ // C++ includes used for precompiling -*- C++ -*- // Copyright (C) 2003-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // softwar... 阅读全文
posted @ 2018-03-02 19:37 aziint 阅读(330) 评论(0) 推荐(0)
摘要: Description 你要购买 $m$ 种物品各一件,一共有 $n$ 家商店,你到第 $i$ 家商店的路费为 $d[i]$ ,在第 $i$ 家商店购买第 $j$ 种物品的费用为 $c[i][j]$ ,求最小总费用。 Input 第一行包含两个正整数 $n,m(1\le n\le 100,1\le 阅读全文
posted @ 2018-03-02 19:23 aziint 阅读(132) 评论(0) 推荐(0)
摘要: Description 给定一棵有 $n$ 个节点的树,相邻两点之间的距离为 $1$ 。 请找到一个点 $x$ ,使其满足所有 $m$ 条限制,其中第i条限制为 $dist(x,a[i])+dist(x,b[i])\le d[i]$ 。 Input 第一行包含一个正整数 $t(1 \le t \le 阅读全文
posted @ 2018-03-02 16:28 aziint 阅读(337) 评论(0) 推荐(0)
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.