08 2015 档案

摘要:Problem Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5... 阅读全文
posted @ 2015-08-30 19:20 martinue 阅读(209) 评论(0) 推荐(0)
摘要:Problem Description 给你一个m×n的整数矩阵,在上面找一个x×y的子矩阵,使子矩阵中所有元素的和最大。 Input 输入数据的第一行为一个正整数T,表示有T组测试数据。每一组测试数据的第一行为四个正整数m,n,x,y(0#include#include#in... 阅读全文
posted @ 2015-08-30 18:41 martinue 阅读(1510) 评论(0) 推荐(0)
摘要:漫步校园 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3508 Accepted Submission(s): 1066... 阅读全文
posted @ 2015-08-30 17:43 martinue 阅读(169) 评论(0) 推荐(0)
摘要:Description A power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be s... 阅读全文
posted @ 2015-08-23 12:28 martinue 阅读(146) 评论(0) 推荐(0)
摘要:Description Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covere... 阅读全文
posted @ 2015-08-23 12:21 martinue 阅读(159) 评论(0) 推荐(0)
摘要:Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s ... 阅读全文
posted @ 2015-08-20 19:08 martinue 阅读(183) 评论(0) 推荐(0)
摘要:Description Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies a... 阅读全文
posted @ 2015-08-20 15:04 martinue 阅读(812) 评论(0) 推荐(1)
摘要:Description Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the... 阅读全文
posted @ 2015-08-19 22:16 martinue 阅读(489) 评论(0) 推荐(0)
摘要:Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (... 阅读全文
posted @ 2015-08-19 22:05 martinue 阅读(196) 评论(0) 推荐(0)
摘要:Description There is a travel agency in Adelton town on Zanzibar island. It has decided to offer its clients, besides many other attractions, s... 阅读全文
posted @ 2015-08-19 21:43 martinue 阅读(182) 评论(0) 推荐(0)
摘要:Description 杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在... 阅读全文
posted @ 2015-08-19 21:32 martinue 阅读(403) 评论(0) 推荐(0)
摘要:Description You are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks ... 阅读全文
posted @ 2015-08-18 19:47 martinue 阅读(149) 评论(0) 推荐(0)
摘要:Description Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Bec... 阅读全文
posted @ 2015-08-18 19:33 martinue 阅读(146) 评论(0) 推荐(0)
摘要:Description Ali has taken the Computer Organization and Architecture course this term. He learned that there may be dependence between instructi... 阅读全文
posted @ 2015-08-18 19:21 martinue 阅读(396) 评论(0) 推荐(0)
摘要:Description 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 h... 阅读全文
posted @ 2015-08-18 19:17 martinue 阅读(296) 评论(0) 推荐(0)
摘要:Description 有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。 球赛的规则如下: 如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。 如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军... 阅读全文
posted @ 2015-08-18 19:11 martinue 阅读(801) 评论(0) 推荐(0)
摘要:Description 有N个比赛队(1#include #include #include using namespace std;int a[510][510],rd[510],z[510];void bfs(int n){ int x=0; while(x<n) ... 阅读全文
posted @ 2015-08-18 19:01 martinue 阅读(121) 评论(0) 推荐(0)
摘要:说明转载出处:http://www.cppblog.com/mythit/archive/2009/04/21/80633.html 感谢大牛的博客!! 首先简要介绍一下AC自动机:Aho-Corasick automation,该算法在1975年产生于贝尔实验室,是著名的多模匹配算法之一。一个... 阅读全文
posted @ 2015-08-13 21:20 martinue 阅读(204) 评论(0) 推荐(0)
摘要:Description The Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, except f... 阅读全文
posted @ 2015-08-13 17:06 martinue 阅读(587) 评论(0) 推荐(0)
摘要:Description A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find al... 阅读全文
posted @ 2015-08-12 15:07 martinue 阅读(184) 评论(0) 推荐(0)
摘要:Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input 输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过... 阅读全文
posted @ 2015-08-12 14:45 martinue 阅读(156) 评论(0) 推荐(0)
摘要:Description Ignatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a hist... 阅读全文
posted @ 2015-08-12 14:36 martinue 阅读(187) 评论(0) 推荐(0)
摘要:Description Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the pho... 阅读全文
posted @ 2015-08-12 14:28 martinue 阅读(255) 评论(0) 推荐(0)
摘要:Description Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes ar... 阅读全文
posted @ 2015-08-10 14:52 martinue 阅读(269) 评论(0) 推荐(0)
摘要:Description A segment and all segments which are connected with it compose a segment set. The size of a segment set is the number of segments in... 阅读全文
posted @ 2015-08-10 14:44 martinue 阅读(121) 评论(0) 推荐(0)
摘要:Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法... 阅读全文
posted @ 2015-08-10 14:25 martinue 阅读(156) 评论(0) 推荐(0)
摘要:Description Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two differen... 阅读全文
posted @ 2015-08-10 14:19 martinue 阅读(1153) 评论(0) 推荐(0)
摘要:Description 严重急性呼吸系统综合症( SARS), 一种原因不明的非典型性肺炎,从2003年3月中旬开始被认为是全球威胁。为了减少传播给别人的机会, 最好的策略是隔离可能的患者。 在Not-Spreading-Your-Sickness大学( NSYSU), 有许多学生团体。... 阅读全文
posted @ 2015-08-10 14:06 martinue 阅读(166) 评论(0) 推荐(0)
摘要:Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of sev... 阅读全文
posted @ 2015-08-08 12:02 martinue 阅读(125) 评论(0) 推荐(0)
摘要:Buy Tickets Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 15869 Accepted: 7905 Description Railway tickets were diffi... 阅读全文
posted @ 2015-08-07 17:24 martinue 阅读(110) 评论(0) 推荐(0)
摘要:Description A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight mov... 阅读全文
posted @ 2015-08-05 20:37 martinue 阅读(169) 评论(0) 推荐(0)
摘要:Description The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change ... 阅读全文
posted @ 2015-08-05 20:33 martinue 阅读(169) 评论(0) 推荐(0)
摘要:Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the di... 阅读全文
posted @ 2015-08-05 20:26 martinue 阅读(123) 评论(0) 推荐(0)
摘要:Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的... 阅读全文
posted @ 2015-08-05 20:23 martinue 阅读(144) 评论(0) 推荐(0)
摘要:Description Given A,B,C, You should quickly calculate the result of A^B mod C. (1#includeusing namespace std;typedef __int64 ll;ll quick(ll a,l... 阅读全文
posted @ 2015-08-05 20:17 martinue 阅读(149) 评论(0) 推荐(0)
摘要:Description Xiaoming has just come up with a new way for encryption, by calculating the key from a publicly viewable number in the following way... 阅读全文
posted @ 2015-08-05 20:12 martinue 阅读(150) 评论(0) 推荐(0)
摘要:Every year there is the same problem at Halloween: Each neighbour is only willing to give a certaintotal number of sweets on that day, no matter how... 阅读全文
posted @ 2015-08-05 20:06 martinue 阅读(128) 评论(0) 推荐(0)
摘要:Description 可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能... 阅读全文
posted @ 2015-08-05 19:55 martinue 阅读(271) 评论(0) 推荐(0)
摘要:Description After a day trip with his friend Dick, Harry noticed a strange pattern of tiny holes in the door of his SUV. The local American Tir... 阅读全文
posted @ 2015-08-04 11:36 martinue 阅读(122) 评论(0) 推荐(0)
摘要:Description Diophantus of Alexandria was an egypt mathematician living in Alexandria. He was one of the first mathematicians to study equations ... 阅读全文
posted @ 2015-08-02 10:18 martinue 阅读(220) 评论(0) 推荐(0)
摘要:Description 假设x是一个正整数,它的值不超过65535(即1#includeusing namespace std;bool p[65545];int su[65545],k=0,num[65545],yz[65545];void get(){ memset(p,1,s... 阅读全文
posted @ 2015-08-02 10:13 martinue 阅读(173) 评论(0) 推荐(0)
摘要:The Sports Association of Bangladesh is in great problem with their latest lottery ‘Jodi laiga Jai’. There are so many participants this time that t... 阅读全文
posted @ 2015-08-02 10:09 martinue 阅读(333) 评论(0) 推荐(0)
摘要:Description Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 ... 阅读全文
posted @ 2015-08-02 09:57 martinue 阅读(150) 评论(0) 推荐(0)
摘要:Description 寒假又快要到了,不过对于lzx来说,头疼的事又来了,因为众多的后宫都指望着能和lzx约会呢,lzx得安排好计划才行。 假设lzx的后宫团有n个人,寒假共有m天,而每天只能跟一位后宫MM约会,并且由于后宫数量太过庞大了,而寒假的天数太少,所以lzx在寒假里不会与一... 阅读全文
posted @ 2015-08-02 09:53 martinue 阅读(159) 评论(0) 推荐(0)
摘要:Description 154. Factorial time limit per test: 0.25 sec. memory limit per test: 4096 KB input: standard input output: standard output Y... 阅读全文
posted @ 2015-08-02 09:51 martinue 阅读(149) 评论(0) 推荐(0)