随笔分类 -  寒假训练2019

摘要:有四种类型; 单源:dij,spfa,bellman-ford 多源:floyd dij有两种: 一个复杂度为n^2,一个复杂度是m*logn 畅通工程续 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案 阅读全文
posted @ 2019-02-24 20:03 EchoZQN 阅读(175) 评论(0) 推荐(0)
摘要:动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种 阅读全文
posted @ 2019-02-15 21:45 EchoZQN 阅读(158) 评论(0) 推荐(0)
摘要:省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态。现请你编写程序,计算出全省畅通需要的最低成本。 Input测试输入包含若干测试用例。每个 阅读全文
posted @ 2019-02-15 16:55 EchoZQN 阅读(180) 评论(0) 推荐(0)
摘要:相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件, 阅读全文
posted @ 2019-02-15 16:21 EchoZQN 阅读(166) 评论(0) 推荐(0)
摘要:dalao视频:https://www.bilibili.com/video/av4768483 https://www.bilibili.com/video/av4768483?p=2 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可 阅读全文
posted @ 2019-02-15 14:38 EchoZQN 阅读(120) 评论(0) 推荐(0)
摘要:K - How Many Tables Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at 阅读全文
posted @ 2019-02-14 21:33 EchoZQN 阅读(132) 评论(0) 推荐(0)
摘要:Chiaki has n intervals and the i-th of them is [li, ri]. She wants to delete some intervals so that there does not exist three intervals a, b and c su 阅读全文
posted @ 2019-02-13 21:59 EchoZQN 阅读(155) 评论(0) 推荐(0)
摘要:【题型一】直线分割平面 在一个平面上有一个圆和n条直线,这些直线中每一条在圆内同其他直线相交,假设没有3条直线相交于一点,试问这些直线将圆分成多少区域。 分析: 当添加第N条,为了使平面最多, 则第N条直线要与前面的N-1条直线都相交,且没有任何三条直线相交一个点。 则添加第N条直线会多N-1个交点 阅读全文
posted @ 2019-02-13 13:00 EchoZQN 阅读(424) 评论(0) 推荐(0)
摘要:Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea 阅读全文
posted @ 2019-02-10 14:30 EchoZQN 阅读(257) 评论(0) 推荐(0)
摘要:Polycarp has recently got himself a new job. He now earns so much that his old wallet can't even store all the money he has. Berland bills somehow com 阅读全文
posted @ 2019-02-10 14:22 EchoZQN 阅读(175) 评论(0) 推荐(0)
摘要:A factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always del 阅读全文
posted @ 2019-02-09 15:55 EchoZQN 阅读(207) 评论(0) 推荐(0)
摘要:Farmer John has received a noise complaint from his neighbor, Farmer Bob, stating that his cows are making too much noise. FJ's N cows (1 <= N <= 10,0 阅读全文
posted @ 2019-02-09 15:51 EchoZQN 阅读(169) 评论(0) 推荐(0)
摘要:题目 题目大意:这个题目就是大小不超过9*9的迷宫,给你起点终点和起点的方向,让你进行移动移动特别之处是不一定上下左右都可以,只有根据方向确定可以走的方向。思路:需要写一个读入函数,这个需要读入起点,终点,方向(简单),还有就是接下来几行的不同位置可以转的方向,可以写几个函数,根据函数来判断方向,最 阅读全文
posted @ 2019-02-08 22:16 EchoZQN 阅读(104) 评论(0) 推荐(0)
摘要:The Robot Moving Institute is using a robot in their local store to transport different items. Of course the robot should spend only the minimum time 阅读全文
posted @ 2019-02-07 15:10 EchoZQN 阅读(164) 评论(0) 推荐(0)
摘要:What are you doing at the end of the world? Are you busy? Will you save us? What are you doing at the end of the world? Are you busy? Will you save us 阅读全文
posted @ 2019-02-07 12:35 EchoZQN 阅读(119) 评论(0) 推荐(0)
摘要:Some company is going to hold a fair in Byteland. There are nn towns in Byteland and mm two-way roads between towns. Of course, you can reach any town 阅读全文
posted @ 2019-02-04 12:33 EchoZQN 阅读(206) 评论(0) 推荐(0)
摘要:A tournament is a directed graph without self-loops in which every pair of vertexes is connected by exactly one directed edge. That is, for any two ve 阅读全文
posted @ 2019-02-04 10:17 EchoZQN 阅读(142) 评论(0) 推荐(0)
摘要:There is a rectangular grid of size n×mn×m . Each cell has a number written on it; the number on the cell (i,ji,j ) is ai,jai,j . Your task is to calc 阅读全文
posted @ 2019-02-04 09:41 EchoZQN 阅读(181) 评论(0) 推荐(0)
摘要:T. Chur teaches various groups of students at university U. Every U-student has a unique Student Identification Number (SIN). A SIN s is an integer in 阅读全文
posted @ 2019-01-19 10:24 EchoZQN 阅读(155) 评论(0) 推荐(0)