随笔分类 -  vjugde

摘要:题解: /*bfs: WA了n次,主要是考虑策略时想法错了。 其实每到一个点时就应该把改点以及该方向的点全都遍历一次,这样才能保证 到达改点时是最优策略,其次,因为交叉关系,vis[][]应该放在while判断里面。*/import java.util.LinkedList; import java 阅读全文
posted @ 2020-04-17 23:58 BlueValentines 阅读(127) 评论(0) 推荐(0)
摘要:You want to perform the combo on your opponent in one popular fighting game. The combo is the string ss consisting of nn lowercase Latin letters. To p 阅读全文
posted @ 2020-03-13 17:40 BlueValentines 阅读(300) 评论(0) 推荐(0)
摘要:There are nn points on a coordinate axis OXOX . The ii -th point is located at the integer point xixi and has a speed vivi . It is guaranteed that no 阅读全文
posted @ 2020-03-09 10:17 BlueValentines 阅读(368) 评论(0) 推荐(0)
摘要:You are given two integers nn and dd . You need to construct a rooted binary tree consisting of nn vertices with a root at the vertex 11 and the sum o 阅读全文
posted @ 2020-03-09 10:13 BlueValentines 阅读(455) 评论(0) 推荐(0)
摘要:You are given three integers a≤b≤ca≤b≤c . In one move, you can add +1+1 or −1−1 to any of these integers (i.e. increase or decrease any number by one) 阅读全文
posted @ 2020-03-09 10:07 BlueValentines 阅读(508) 评论(0) 推荐(0)
摘要:Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For 阅读全文
posted @ 2020-03-02 09:41 BlueValentines 阅读(169) 评论(0) 推荐(0)
摘要:During his last sabbatical, professor M. A. Ya made a surprising discovery about the old Maya calendar. From an old knotted message, professor discove 阅读全文
posted @ 2020-03-01 17:27 BlueValentines 阅读(124) 评论(0) 推荐(0)
摘要:Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has decided that he needs t 阅读全文
posted @ 2020-02-29 19:51 BlueValentines 阅读(230) 评论(0) 推荐(0)
摘要:Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the stat 阅读全文
posted @ 2020-02-29 19:44 BlueValentines 阅读(136) 评论(0) 推荐(0)