摘要: DescriptionGiven a set of sticks of various lengths, is it possible to join them end-to-end to form a square?InputThe first line of input contains N, ... 阅读全文
posted @ 2014-02-07 15:27 chen2013 阅读(265) 评论(0) 推荐(0)
摘要: 描述In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjac... 阅读全文
posted @ 2014-02-06 13:47 chen2013 阅读(375) 评论(0) 推荐(0)
摘要: 描述很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 输入本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0#include using namespace std;#define lson l,m,rt >1; build(lson); build(rson); PushUP(rt); }void update(int p, int sc, int l, int r, in 阅读全文
posted @ 2014-01-28 19:13 chen2013 阅读(225) 评论(0) 推荐(0)
摘要: 描述 Dandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble ab... 阅读全文
posted @ 2014-01-28 12:57 chen2013 阅读(202) 评论(0) 推荐(0)
摘要: 描述 有N个比赛队(1#include #include #include using namespace std;#define MAXN 505int n,m,cnt;int head[MAXN];int indgree[MAXN];int flag[MAXN];struct EdgeNode{... 阅读全文
posted @ 2014-01-28 10:50 chen2013 阅读(238) 评论(0) 推荐(0)
摘要: 描述You have n computers numbered from 1 to n and you want to connect them to make a small local area network (LAN). All connections are two-way (that i... 阅读全文
posted @ 2014-01-28 08:52 chen2013 阅读(402) 评论(0) 推荐(0)
摘要: 描述 You are the owner of SmallCableCo and have purchased the franchise rights for a small town. Unfortunately, you lack enough funds to start your busi... 阅读全文
posted @ 2014-01-27 18:24 chen2013 阅读(329) 评论(0) 推荐(0)
摘要: 描述 给定若干家庭成员之间的关系,判断2个人是否属于同一家庭,即2个人之间均可以通过这些关系直接或者间接联系。输入 输入数据有多组,每组数据的第一行为一个正整数n(1#include #include #include #define MAXN 350using namespace std;int ... 阅读全文
posted @ 2014-01-27 12:15 chen2013 阅读(376) 评论(0) 推荐(0)
摘要: 描述Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to... 阅读全文
posted @ 2014-01-27 10:16 chen2013 阅读(251) 评论(0) 推荐(0)
摘要: 描述 Minya Konka decided to go to Fuzhou to participate in the ACM regional contest at their own expense.Through the efforts, they got a small amount of... 阅读全文
posted @ 2014-01-26 22:40 chen2013 阅读(309) 评论(0) 推荐(0)