[题目链接]:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=378 [题意] 给你n个方形; 由3个属性,长宽高决定; 你可以任意摆放这个方形(即把哪一面朝下方); 然后每种方形都有无限个; 一个方形能够摆在另外一个方形上面,当且仅当这个方形的长和宽都严格大于另外一个方形的长和宽(即changi>changj &&…
http://poj.org/problem?id=1179 Description Polygon is a game for one player that starts on a polygon with N vertices, like the one in Figure 1, where N=4. Each vertex is labelled with an integer and each edge is labelled with either the symbol + (add…
UVA 10003 Cutting Sticks+区间DP 纵有疾风起 题目大意 有一个长为L的木棍,木棍中间有n个切点.每次切割的费用为当前木棍的长度.求切割木棍的最小费用 输入输出 第一行是木棍的长度L,第二行是切割点的个数n,接下来的n行是切割点在木棍上的坐标. 输出切割木棍的最小费用 前话-区间dp简单入门 区间dp的入门下面博客写的非常好,我就是看的他们博客学会的,入门简单,以后的应用就得靠自己了. https://blog.csdn.net/qq_41661809/article/d…
Problem H Game Show Math Input: standard input Output: standard output Time Limit: 15 seconds A game show in Britain has a segment where it gives its contestants a sequence of positive numbers and a target number. The contestant must make a mathemati…
A and B are playing a shooting game on a battlefield consisting of square-shaped unit blocks. The blocks are occupying some consecutive columns, and the perimeter of the figure equals the perimeter of its minimal bounding box. The figure (a) below is…
/* 记忆化搜索,第二维判断是否是6 */ #include<stdio.h> #include<string.h> #define N 9 int dp[N][2],digit[N]; int dfs(int len,int cnt,int ok) {//cnt代表是否是6,ok代表前一个是当前为最大值,并且当前也是最大值 if(!len)return 1; if(!ok&&dp[len][cnt]!=-1)return dp[len][cnt]; int i,a…
Description   Perhaps you have heard of the legend of the Tower of Babylon. Nowadays many details of this tale have been forgotten. So now, in line with the educational nature of this contest, we will tell you the whole story: The babylonians had n t…
传送门 Description Perhaps you have heard of the legend of the Tower of Babylon. Nowadays many details of this tale have been forgotten. So now, in line with the educational nature of this contest, we will tell you the whole story: The babylonians had n…
 题意  给你n种长方体  每种都有无穷个  当一个长方体的长和宽都小于还有一个时  这个长方体能够放在还有一个上面  要求输出这样累积起来的最大高度 由于每一个长方体都有3种放法  比較不好控制   能够把一个长宽高分成三个长方体  高度是固定的  这样就比較好控制了 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define maxn 105 int x[…
每一个长方形都有六种放置形态,其实可以是三种,但是判断有点麻烦直接用六种了,然后按照底面积给这些形态排序,排序后就完全变成了LIS的问题.代码如下: #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define N 1818 struct Node { int x,y,z,area; void init(int a,…