题意: 给出 $n$ 个花瓶,编号 $[0,n 1]$,一开始每个花瓶是空的。输入 $K$。$Alice$ 有两种操作,共 $m$ 个: $K=1$:输入 $A,F$。$Alice$ 将从花瓶 $A$ 开始,向空花瓶中插入花,如果没有插完,则多余的花舍弃; $K=2$:输入 $A,B$。$Alice ...
分类:
其他好文 时间:
2020-03-13 15:58:26
阅读次数:
59
原文:https://www.cnblogs.com/qiwu1314/p/5899545.html?utm_source=itdadao&utm_medium=referral 下载Aspose.Words .dll http://pan.baidu.com/s/1c8659k 在vs2010中新 ...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6638 There are nn pirate chests buried in Byteland, labeled by 1,2,…,n1,2,…,n. The ii-th chest's locati ...
分类:
其他好文 时间:
2020-03-12 11:25:40
阅读次数:
49
Problem Description 在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗? Input 输入数据首先包括一个整数C,表示测试 ...
分类:
其他好文 时间:
2020-03-11 10:30:40
阅读次数:
41
过山车 HDU - 2063 分析匈牙利算法,其实就是找得到就匹配,找不到这个点换一下看看能不能匹配; #include<bits/stdc++.h> using namespace std; #define pb push_back const int N=6e2+5; vector<int>e[ ...
分类:
其他好文 时间:
2020-03-10 19:47:59
阅读次数:
62
Problem Description 把一个字符三角形掏空,就能节省材料成本,减轻重量,但关键是为了追求另一种视觉效果。在设计的过程中,需要给出各种花纹的材料和大小尺寸的三角形样板,通过电脑临时做出来,以便看看效果。 Input 每行包含一个字符和一个整数n(0<n<41),不同的字符表示不同的花 ...
分类:
其他好文 时间:
2020-03-10 11:49:36
阅读次数:
44
贪心+树形dp 尽可能低价买入,高价卖出 设好转移规律就好了 长记性 dp[i][1] i号节点或者他的某个子孙中最低买入价格//要靠考虑路费 dp[i][0] i号节点或者他的某个子孙中最高卖出价格//要考虑路费 #include<iostream> #include<cstring> #incl ...
分类:
其他好文 时间:
2020-03-10 01:11:40
阅读次数:
64
Problem Description Give you a number on base ten,you should output it on base two.(0 < n < 1000) Input For each case there is a postive number n on b ...
分类:
其他好文 时间:
2020-03-09 20:52:34
阅读次数:
49
Here is a famous story in Chinese history. "That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play hor ...
分类:
其他好文 时间:
2020-03-09 20:48:05
阅读次数:
56
Problem Description 对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39<=x<y<=50),判定该表达式的值是否都为素数。 Input 输入数据有多组,每组占一行,由两个整数x,y组成,当x=0,y=0时,表示输入结束,该行不做处理。 Output ...
分类:
其他好文 时间:
2020-03-09 13:33:47
阅读次数:
35