摘要: DNA (Deoxyribonucleic Acid) is the molecule which contains the genetic instructions. It consists of four different nucleotides, namely Adenine, Thymine, Guanine, and Cytosine as shown in Figure 1. If we represent a nucleotide by its initial character, a DNA strand can be regarded as a ... 阅读全文
posted @ 2013-07-13 18:26 默默如潮 阅读(400) 评论(0) 推荐(0) 编辑
摘要: Ancient Roman empire had a strong government system with various departments, including a secret service department. Important documents were sent between provinces and the capital in encrypted form to prevent eavesdropping. The most popular ciphers in those times were so calledsubstitution cipheran 阅读全文
posted @ 2013-07-13 17:47 默默如潮 阅读(389) 评论(0) 推荐(0) 编辑
摘要: Building designingAn architect wants to design a very high building. The building will consist of some floors, and each floor has a certain size. The size of a floor must be greater than the size of the floor immediately above it. In addition, the designer (who is a fan of a famous Spanish football 阅读全文
posted @ 2013-07-13 17:23 默默如潮 阅读(366) 评论(0) 推荐(0) 编辑
摘要: Building BlockTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1982Accepted Submission(s): 598Problem DescriptionJohn are playing with blocks. There are N blocks (1 2 #include 3 #include 4 #define maxlen 30010 5 using namespace std; 6 int father[ma. 阅读全文
posted @ 2013-07-12 19:33 默默如潮 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 题目大意:一开始有一条语句printf("Hello World!\n");你可以选择复制粘贴,问要输出n行Hello World!最少要复制几次?分析:大水题,每次复制粘贴当前所有的语句则可以使次数最少,所以答案就是ceil(l(logn)/(log2))。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int main() 7 { 8 int n,Case=1; 9 while(scanf("%d",&n)==1)10 {11 if(n 2 #incl 阅读全文
posted @ 2013-07-12 19:16 默默如潮 阅读(312) 评论(0) 推荐(0) 编辑
摘要: Problem E: ExpressionsArithmetic expressions are usually written with the operators in between the two operands (which is called infix notation). For example, (x+y)*(z-w) is an arithmetic expression in infix notation. However, it is easier to write a program to evaluate an expression if the expressi 阅读全文
posted @ 2013-07-11 14:24 默默如潮 阅读(338) 评论(0) 推荐(0) 编辑
摘要: Problem A: 一日三餐开销水题,基本上都过了,直接贴代码: 1 #include 2 #include 3 using namespace std; 4 int main() 5 { 6 double a,b,c; 7 while(cin>>a>>b>>c) 8 { 9 printf("%.1f\n",a+b+c);10 }11 }View CodeProblem B: 一道简单的题简单排序,只要从小到大排序输出就可以了,注意数组最后没有空格。#include #include #includeusing namespace st 阅读全文
posted @ 2013-07-09 21:43 默默如潮 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 题目大意:给定n个居民的年龄(1-100),按从小到大输出输入:第一行一个整数n表示人数(0#include #include using namespace std;int main (){ int hashs[110]; int n,x; while(scanf("%d",&n),n) { memset(hashs,0,sizeof(hashs)); for(int i=0;i<n;++i) { scanf("%d",&x); hashs[x]++; } ... 阅读全文
posted @ 2013-07-08 21:24 默默如潮 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 题目大意:你有n个部下,每个部下要完成一个任务,你需要花费bi去交代任务给第i个部下,随后他需要ji分钟去完成,现在你需要安排这些任务分配顺序,使得最终的完成任务时间(所有任务都完成)最小。输入:第一行一个整数n表示任务数。接下来n行为bi,ji代表交代任务的时间以及执行任务的时间。输出:每组数据输出最早完成所有任务的时间。分析:这道题目属于贪心,我们来考虑这样的情况。交换任务x、y(将y提到x前)分为以下两种情况:1、y比x早结束那么将任务y提到x前,完成这两个任务需要的时间比交换前的要晚。2、y比x晚结束若要求最后完成的时间比交换前则急需要B[x]+J[x]+B[y]>=B[y]+J 阅读全文
posted @ 2013-07-08 18:57 默默如潮 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 题目大意:有头龙有n个头,你雇佣骑士去砍掉这些头,一共有m个骑士,一个骑士对应有一个能力值x,同时x也代表你雇佣他的费用,只有当能力值大于或等于龙头的大小时可以砍掉这个头,你现在需要计算的是杀死这头龙(砍掉所有龙头)最小的雇佣费用。输入:第一行两个整数,n,m当n,m都为零时结束接下来n行为头的大小、在接下来m行是m个骑士的能力值x。输出:每组数据输出最小的雇佣费用。分析:这道题目属于贪心,我们应该尽量选择能力值与头大小相近(大于等于)的骑士去砍这个头,这样所需要的费用是最少的,所以可以按骑士的能力值排序(小到大),再将龙头大小排序,然后循环判断是否i骑士可以杀死j龙头,如果可以,则雇佣该骑士 阅读全文
posted @ 2013-07-08 18:39 默默如潮 阅读(204) 评论(0) 推荐(0) 编辑