http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1336 There is an interesting calculator. It has 3 rows of buttons. Row 1: button 0, 1, 2, 3, ..., 9. Pressing each button appends that digit to the end of the display. Row 2: button +0, +1, +2, +3, ...…
1336: Interesting Calculator 这道题被LZQ抢了一血,于是去读题发现题意不难,纯广搜结果写的一塌糊涂. 题意:给你两个数x,y.由x每次可以经过一系列操作变换,每个变换都有一定的费用,求x变换到y的最小费用下最小步数. 思路:类似最短路的思想,当时只想到每个点有30个方向可以走,于是直接广搜,但不是TLE就是MLE,后来比完赛看题解才知道要用优先队列.最小费用优先,然后最小步数优先.每一步都是前一步到达的,但一个点可以由多个点到达,这时我们肯定要取最优的那一步嘛.如果…
Description Farmer John打算将电话线引到自己的农场,但电信公司并不打算为他提供免费服务.于是,FJ必须为此向电信公司支付一定的费用. FJ的农场周围分布着N(1 <= N <= 1,000)根按1..N顺次编号的废弃的电话线杆,任意两根电话线杆间都没有电话线相连.一共P(1 <= P <= 10,000)对电话线杆间可以拉电话线,其余的那些由于隔得太远而无法被连接. 第i对电话线杆的两个端点分别为A_i.B_i,它们间的距离为 L_i (1 <= L_i…
There is an interesting calculator. It has 3 rows of buttons. Row 1: button 0, 1, 2, 3, ..., 9. Pressing each button appends that digit to the end of the display. Row 2: button +0, +1, +2, +3, ..., +9. Pressing each button adds that digit to the disp…
Interesting Calculator Time Limit: 2 Sec  Memory Limit: 128 MB Submit: 163  Solved: 49 Description There is an interesting calculator. It has 3 rows of buttons.   Row 1: button 0, 1, 2, 3, ..., 9. Pressing each button appends that digit to the end of…
先上题目: 12664 Interesting CalculatorThere is an interesting calculator. It has 3 rows of button.• Row 1: button 0, 1, 2, 3, . . . , 9. Pressing each button appends that digit to the end of the display.• Row 2: button +0, +1, +2, +3, . . . , +9. Pressin…
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1659 题意是找一个图的中心,图的中心定义是某一个点到其他点的最大距离最小,如果有多个排序输出. 注意这里大到其他点的距离是找一个最短的距离,那么就转化成了最短路的问题,求出每个点与其它点的最大距离, 保存并且求出最大距离中的最小距离,然后判断有几个点满足条件输出即可. #include <iostream> #include <cstdio> #include <cmath&…
题目大意: 不想介绍,题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1259 bfs求最短路. 这里因为2-9,到达同样的点不计步数,那我们不能每次bfs都遍历一个图找到所有相同的点,所以这里用vector[10],保存对应的2-9的相同的节点 题目本身比较简单,只是考虑的东西有点多,慢慢写就行了 #include <cstdio> #include <cstring> #include <iostream>…
C. Recycling Bottles time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It was recycling day in Kekoland. To celebrate it Adil and Bera went to Central Perk where they can take bottles from t…
http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1808 题意: Bobo 居住在大城市 ICPCCamp. ICPCCamp 有 n 个地铁站,用 1,2,…,n 编号. m 段双向的地铁线路连接 n 个地铁站,其中第 i 段地铁属于 ci 号线,位于站 ai,bi 之间,往返均需要花费 ti 分钟(即从 ai 到 bi 需要 ti 分钟,从 bi 到 ai 也需要 ti 分钟). 众所周知,换乘线路很麻烦.如果乘坐第 i 段地铁来到地铁站…