2013年8月6日
摘要: Generating Fast, Sorted PermutationInput: Standard InputOutput: Standard OutputGenerating permutation has always been an important problem in computer science. In this problem you will have to generate the permutation of a given string in ascending order. Remember that your algorithm must be efficie 阅读全文
posted @ 2013-08-06 10:42 Areson 阅读(116) 评论(0) 推荐(0)
  2013年8月5日
摘要: 查找Time Limit 1000msMemory Limit 65536Kdescription给你一串没有重复数字的递增序列,我们想要知道自己输入的数字在该序列的哪个位置。当然该序列的数字比较多。 input测试数组有多组,每组测试数据第一行输入一个整数n,(1 2 #include 3 using namespace std; 4 5 int main() 6 { 7 int n,m,s,e,t,x,f,k,i,a[100001]; 8 while(cin>>n) 9 {10 for(i=0;i>t;12 for(i... 阅读全文
posted @ 2013-08-05 20:00 Areson 阅读(248) 评论(0) 推荐(0)
摘要: DescriptionOne hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos. They rushed home, dying of thirst, and decided to divide the berry, however they fac 阅读全文
posted @ 2013-08-05 19:56 Areson 阅读(416) 评论(0) 推荐(0)
摘要: DescriptionGetting in LineComputer networking requires that the computers in the network be linked.This problem considers a ``linear" network in which the computers are chained together so that each is connected to exactly two others except for the two computers on the ends of the chain which a 阅读全文
posted @ 2013-08-05 19:15 Areson 阅读(172) 评论(0) 推荐(0)
摘要: Description Where is the Marble?Raju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju would place the marbles one after another in ascending order of the numbers written on them. Then Meena would ask Raju to find the first marbl 阅读全文
posted @ 2013-08-05 19:04 Areson 阅读(162) 评论(0) 推荐(0)