Compromise In a few months the European Currency Union will become a reality. However, to join the club, the Maastricht criteria must be fulfilled, and this is not a trivial task for the countries (maybe except for Luxembourg). To enforce that Ger…
Problem Description The company "21st Century Fruits" has specialized in creating new sorts of fruits by transferring genes from one fruit into the genome of another one. Most times this method doesn't work, but sometimes, in very rare cases, a…
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<ctype.h> #include<algorithm> #define N 1010 using namespace std; int dp[N], path[N][N], w[N]; int main() { int v, n; while(~scanf("%d", &v)) { sca…
题目链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=995 Problem D: The Necklace My little sister had a beautiful necklace made of colorful beads. Two successive beads in the necklace shared a c…
Scandinavians often make vacation during the Easter holidays in the largest ski resort Are. Are provides fantastic ski conditions, many ski lifts and slopes of various difficulty profiles. However, some lifts go faster than others, and some are so po…
POJ 2250 Compromise(LCS)解题报告 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87125#problem/D 题目: Description In a few months the European Currency Union will become a reality. However, to join the club, the Maastricht criteria must be fulf…
Ignatius and the Princess I Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18847 Accepted Submission(s): 6090Special Judge Problem Description The Princess has been abducted by the BEelzebub…
FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence so that the weights are increasing, but the speed…
In Frobnia, a far-away country, the verdicts in court trials are determined by a jury consisting of members of the general public. Every time a trial is set to begin, a jury has to be selected, which is done as follows. First, several people are draw…
Problem Description FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence so that the weights are incre…
A. Shortest path of the king time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has busi…
624 - CD 题意:一段n分钟的路程,磁带里有m首歌,每首歌有一个时间,求最多能听多少分钟的歌,并求出是拿几首歌. 思路:如果是求时常,直接用01背包即可,但设计到打印路径这里就用一个二维数组标记一下即可. const int N=1e3+10; int n,m,a[N],d[N],v[N][N]; int main() { while(~scanf("%d%d",&n,&m)) { memset(v,0,sizeof(v)); memset(d,0,sizeof(…