1051: Divide ChocolateTime Limit: 1 Sec  Memory Limit: 128 MB[Submit][Status][Web Board]DescriptionIt is well known that Claire likes dessert very much, especially chocolate. But as a girl
原创 2022-09-07 10:51:52
46阅读
2011-12-19 02:42:34地址:http://acm.hdu.edu.cn/showproblem.php?pid=1051题意:有n个木棍长为l重为w。机器处理木棍,若前一根的l和w均不小于后一根,则不需要额外时间,否则需要额外时间1。问最小需要多少时间。mark:网上说是贪心,想了很久想不明白,画了一下sample1的图(l当做x,w当做y描点),恍然大悟。把所有元素按l从大到小排序后,其实就是导弹拦截系统的问题,求一个LIS(关于最少导弹拦截数等于最长非降子序列长度的证明,因为之前和其他同学讨论过,所以知道挺麻烦的。讨论了两天才勉强证出来,还很不简洁,不过这个结论还是对的)。
转载 2012-01-06 22:25:00
33阅读
就是一个tarjan
转载 2016-11-21 22:51:00
42阅读
2评论
://oj.lcsyzx.cn/JudgeOnline/problem.php?id=1051
转载 2017-03-04 19:12:00
65阅读
2评论
1051. Pop Sequence (25)时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序
原创 2022-08-30 09:58:54
73阅读
题目#include <cstdio>#include <cmath>int main() { double a,b,c,d
原创 2023-06-27 10:19:17
89阅读
leetcode
转载 2019-05-26 12:09:00
50阅读
2评论
此题是一道
转载 2012-11-15 15:29:00
77阅读
2评论
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given s
转载 2020-05-08 17:23:00
152阅读
2评论
1051. 复数乘法 (15)时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, Yue复数可以写成(A + Bi)的常规形式,其中A是实部,B是虚部,i是虚数单位,满足i2 = -1;也可以写成
题目地址:http://codevs.cn/problem/1051/ 分析: ——题目难度:提高一等 1、数据结构(Data Structure):①Hash(用map或人工)②Stack(栈) 2、算法(Algorithm): DP 穷举 3、题目简述: 给出了n个按长度排序单词,假设某单词i是
转载 2017-06-18 09:46:00
32阅读
2评论
题目题意: 给定k个序列,问是否为合法的出栈顺序。tip:模拟出栈#include<iostream>#incr(int i=0; i<...
原创 2023-06-27 10:18:27
43阅读
1051: [HAOI2006]受欢迎的牛 Description 每一头牛的愿望就是变成一头最受欢迎的牛。现在有N头牛,给你M对整数(A,B),表示牛A认为牛B受欢迎。 这 种关系是具有传递性的,如果A认为B受欢迎,B认为C受欢迎,那么牛A也认为牛C受欢迎。你的任务是求出有多少头 牛被所有的牛认为
转载 2017-02-21 21:50:00
36阅读
2评论
1051 接龙游戏 1051 接龙游戏 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 时间限制: 1 s 时间限制: 1 s 空间限制: 128000 KB 空间限制:
原创 2021-06-04 20:19:52
161阅读
Wooden SticksTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11605Accepted Submission(s): 4792Prob...
转载 2014-10-26 14:02:00
71阅读
2评论
题目地址:点击打开链接思路:贪心+动归AC代码:#include#includeusing namespace std;struct wood{ int head; int tail; int flag;}a[5010];int cmp(struct wood x,struct wood y){ if(x.head != y.head) return x.he
原创 2022-08-04 09:06:20
37阅读
Wooden SticksTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16247    Accepted Submission(s): 6668Problem DescriptionThere is a
原创 2022-08-10 21:35:43
106阅读
1051. Height Checker*https://leetcode.com/problems/height-checker/题目描述Students are asked to stand in non-decreasing order of heights for an annual photo.Return the minimum number of students not s...
原创 2022-05-30 11:22:40
33阅读
http://acm.hdu.edu.cn/showproblem.php?pid=1051#include #include using namespace std;typedef struct{    intLength;    intWeight;}Game;int cmp( const void *a , const void *b ){    Game *c =
原创 2022-08-23 09:07:32
52阅读
设 \(f_{i,j,c,d}\) 表示到第 \(i\) 列有 \(j\) 个联通块,且这一列上面颜色为 \(c\),下面颜色为 \(d\) 的方案数 \((c,d\in\{0,1\},j\le i\times 2)\)。 然后考虑这个状态可以从什么转移而来。 显然有: \(f_{i,j,1,1}= ...
转载 2021-10-29 16:00:00
79阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5