07 2016 档案

B - 递推
摘要:Description 用N个三角形最多可以把平面分成几个区域? Description 用N个三角形最多可以把平面分成几个区域? 用N个三角形最多可以把平面分成几个区域? Input 输入数据的第一行是一个正整数T(1<=T<=10000),表示测试数据的数量.然后是T组测试数据,每组测试数据只包 阅读全文

posted @ 2016-07-31 21:40 踮起脚望天 阅读(142) 评论(0) 推荐(0)

D - 继续畅通工程
摘要:Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态。现请你编写程序,计算出全省畅通需要的最低成本。 Descript 阅读全文

posted @ 2016-07-31 20:38 踮起脚望天 阅读(468) 评论(0) 推荐(0)

H - Funny Car Racing
摘要:There is a funny car racing in a city with n junctions and m directed roads. The funny part is: each road is open and closed periodically. Each road i 阅读全文

posted @ 2016-07-31 20:32 踮起脚望天 阅读(238) 评论(0) 推荐(0)

B - Frogger
摘要:题意:两只青蛙,A和B,A想到B哪里去,但是A得弹跳有限制,所以不能直接到B,但是有其他的石头作为过渡点,可以通过他们到达B,问A到B的所有路径中,它弹跳最大的跨度的最小值 分析:最短路问题,用prim解决的;开始想用dijkstra去做,写了一下发现掌握不熟练写不出来,看了别人的,然后就用了最小生 阅读全文

posted @ 2016-07-27 20:54 踮起脚望天 阅读(443) 评论(0) 推荐(0)

C - Til the Cows Come Home
摘要:题目链接: http://acm.hust.edu.cn/vjudge/contest/66569#problem/A 题意:给你n个点,给出a到b的距离,a,b边是可以互想抵达的,求1到n的最短距离。实质:n个顶点m条边的无向图,求1到n的最短路径。 问题:一开始结果没问题,提交时显示运行错误,改 阅读全文

posted @ 2016-07-27 13:01 踮起脚望天 阅读(387) 评论(0) 推荐(0)

G - 还是畅通工程
摘要:题意:求最小公路长度 分析:本题的实质是最小生成树,可以用prim算法和kruskal算法,我用的是前者 心得:第一次做,知识点还不是很理解,但是大致会用了,还要进一步学习,将它弄懂 Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全 阅读全文

posted @ 2016-07-25 19:18 踮起脚望天 阅读(176) 评论(0) 推荐(0)

F - Jungle Roads
摘要:题目链接:http://poj.org/problem?id=1251 题意:就是给你n个点,告诉你他们的连通情况,让你找一条最短路径使维修道路花费的钱最少,最小生成树问题,可以用prim解法和 kruskal解法,暂时还只会prim解法。 思路:以某一顶点出发,找权值最小的、相邻的边,找到后,并入 阅读全文

posted @ 2016-07-25 19:07 踮起脚望天 阅读(201) 评论(0) 推荐(0)

I - Doing Homework again
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 题意:就是你每次完成一门功课都要花一天的时间,问你怎样安排完成作业的顺序能让你被扣的分数最少。竟然是贪心。。。。。。。。。 分析:开始的思路是先按照所扣分数的多少排序,然后就没有下文了。。。。。。 阅读全文

posted @ 2016-07-24 19:22 踮起脚望天 阅读(213) 评论(0) 推荐(0)

H - Frosh Week
摘要:Description During Frosh Week, students play various fun games to get to know each other and compete against other teams. In one such game, all the fr 阅读全文

posted @ 2016-07-22 19:40 踮起脚望天 阅读(421) 评论(0) 推荐(0)

O - Can you find it?
摘要:Description Give you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, 阅读全文

posted @ 2016-07-22 19:33 踮起脚望天 阅读(203) 评论(0) 推荐(0)

G - Who's in the Middle
摘要:Description FJ is surveying his herd to find the most average cow. He wants to know how much milk this 'median' cow gives: half of the cows give as mu 阅读全文

posted @ 2016-07-22 19:23 踮起脚望天 阅读(141) 评论(0) 推荐(0)

L - Points on Cycle
摘要:Description There is a cycle with its center on the origin. Now give you a point on the cycle, you are to find out the other two points on it, to maxi 阅读全文

posted @ 2016-07-22 19:17 踮起脚望天 阅读(134) 评论(0) 推荐(0)

B - The Suspects
摘要:Description 严重急性呼吸系统综合症( SARS), 一种原因不明的非典型性肺炎,从2003年3月中旬开始被认为是全球威胁。为了减少传播给别人的机会, 最好的策略是隔离可能的患者。 在Not-Spreading-Your-Sickness大学( NSYSU), 有许多学生团体。同一组的学生 阅读全文

posted @ 2016-07-22 19:06 踮起脚望天 阅读(259) 评论(0) 推荐(0)

F - A Simple Problem with Integers
摘要:Description 给出了一个序列,你需要处理如下两种询问。 "C a b c"表示给[a, b]区间中的值全部增加c (-10000 ≤ c ≤ 10000)。 "Q a b" 询问[a, b]区间中所有值的和。 Description 给出了一个序列,你需要处理如下两种询问。 "C a b  阅读全文

posted @ 2016-07-22 19:00 踮起脚望天 阅读(235) 评论(0) 推荐(0)

E - I Hate It
摘要:Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Description 很多学校流行一种比较的习惯 阅读全文

posted @ 2016-07-22 18:56 踮起脚望天 阅读(157) 评论(0) 推荐(0)

D - 敌兵布阵
摘要:Description Lily 特别喜欢养花,但是由于她的花特别多,所以照料这些花就变得不太容易。她把她的花依次排成一行,每盆花都有一个美观值。如果Lily把某盆花照料的好的话,这盆花的美观值就会上升,如果照料的不好的话,这盆花的美观值就会下降。有时,Lily想知道某段连续的花的美观值之和是多少, 阅读全文

posted @ 2016-07-22 18:53 踮起脚望天 阅读(187) 评论(0) 推荐(0)

J~今年暑假不AC
摘要:#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef struct st { int begin; int end; }st; bool cmp(s 阅读全文

posted @ 2016-07-22 18:32 踮起脚望天 阅读(244) 评论(0) 推荐(0)

C - 小Q系列故事——最佳裁判
摘要:Description 过去的2012年对小Q来说是很悲催的一年,失恋了12次,每次都要郁闷1个来月。 好在小Q是个体育迷,在最痛苦的时候,他常常用观看各种体育节目来麻醉自己,比如伦敦奥运会期间,小Q就常常在周末邀上一群单身同事聚在自己的蜗居,一边畅饮啤酒,一边吹牛。 小Q最喜欢看的是跳水,主要原因 阅读全文

posted @ 2016-07-22 18:27 踮起脚望天 阅读(325) 评论(0) 推荐(0)

线段树
摘要:这是从网上看到的两篇博客感觉挺好的就转过来,留作复习的材料。 转载来源:http://www.cnblogs.com/superbin/archive/2010/08/02/1790467.html 线段树(interval tree) 是把区间逐次二分得到的一树状结构,它反映了包括归并排序在内的很 阅读全文

posted @ 2016-07-19 19:48 踮起脚望天 阅读(200) 评论(0) 推荐(0)

K - Hero
摘要:Description When playing DotA with god-like rivals and pig-like team members, you have to face an embarrassing situation: All your teammates are kille 阅读全文

posted @ 2016-07-18 20:51 踮起脚望天 阅读(155) 评论(0) 推荐(0)

H - Frosh Week
摘要:Description During Frosh Week, students play various fun games to get to know each other and compete against other teams. In one such game, all the fr 阅读全文

posted @ 2016-07-18 20:45 踮起脚望天 阅读(183) 评论(0) 推荐(0)

G - Who's in the Middle
摘要:Description FJ is surveying his herd to find the most average cow. He wants to know how much milk this 'median' cow gives: half of the cows give as mu 阅读全文

posted @ 2016-07-18 11:31 踮起脚望天 阅读(103) 评论(0) 推荐(0)

E - Rails
摘要:Description There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately 阅读全文

posted @ 2016-07-16 16:04 踮起脚望天 阅读(229) 评论(0) 推荐(0)

B - Catch That Cow
摘要:Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,00 阅读全文

posted @ 2016-07-16 14:29 踮起脚望天 阅读(733) 评论(2) 推荐(1)

A - 士兵队列训练问题
摘要:Description 某部队进行新兵队列训练,将新兵从一开始按顺序依次编号,并排成一行横队,训练的规则如下:从头开始一至二报数,凡报到二的出列,剩下的向小序号方向靠拢,再从头开始进行一至三报数,凡报到三的出列,剩下的向小序号方向靠拢,继续从头开始进行一至二报数。。。,以后从头开始轮流进行一至二报数 阅读全文

posted @ 2016-07-16 14:09 踮起脚望天 阅读(254) 评论(0) 推荐(0)

H~N皇后问题
摘要:Description 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Description 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意 阅读全文

posted @ 2016-07-16 09:04 踮起脚望天 阅读(621) 评论(0) 推荐(0)

G - Oil Deposits
摘要:G - Oil Deposits Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status G - Oil Deposits Submit Status Description The Geo 阅读全文

posted @ 2016-07-16 08:39 踮起脚望天 阅读(137) 评论(0) 推荐(0)