码迷,mamicode.com
首页 >  
搜索关键字:lightoj 1214    ( 714个结果
LightOJ 1038-Race to 1 Again(概率dp)
题意:给你一个数n每一步这个数可以变为他的因子,直到这个数变为1,求n变到1的期望步数。分析:dp[i],表示i变为1的期望步数,dp[1]=0,dp[n]是答案。dp[i]=sum(dp[j])/tmp+1;(j是i的因子,tmp是i因子的个数化简即可#include #include #incl...
分类:其他好文   时间:2015-08-18 11:39:06    阅读次数:111
LightOJ 1112--Curious Robin Hood
Curious Robin HoodTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%lld & %lluSubmitStatusDescriptionRobin Hood likes to loot rich people since he...
分类:其他好文   时间:2015-08-17 21:37:51    阅读次数:130
Lightoj 1174 - Commandos (bfs)
题目链接: Lightoj 1174 - Commandos题目描述: 有一军队秉承做就要做到最好的口号,准备去破坏敌人的军营。他们计划要在敌人的每一个军营里都放置一个炸弹。军营里有充足的士兵,每个士兵都可以携带充足的炸弹,问这个军队完成任务最少需要时间?(假设士兵在往敌军帐篷里放炸弹时,敌军不.....
分类:其他好文   时间:2015-08-17 21:15:37    阅读次数:129
LightOJ 1422 Halloween Costumes(区间dp)
题目大意: 给你n天要穿的衣服,可以套着穿,但是一旦脱下来就不能载穿了,问n天至少需要多少衣服?做了两个关于区间dp的题,遇到这个题还是不会做,网上搜了一下,感觉也不难,就是自己想不起来。。。思路:dp[i][j]表示从第i天到第j天至少需要多少衣服,那么dp[i][j] = dp[i + 1][j...
分类:其他好文   时间:2015-08-17 21:12:20    阅读次数:147
LightOj 1112 Curious Robin Hood(线段树||树状数组)
Curious Robin Hood Robin Hood likes to loot rich people since he helps the poor people with this money. Instead of keeping all the money together he does another trick. He keeps n sacks where h...
分类:编程语言   时间:2015-08-17 19:38:35    阅读次数:172
Lightoj 1094 - Farthest Nodes in a Tree 【树的直径 裸题】
1094 - Farthest Nodes in a Tree PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Given a tree (a connected graph with no cycles), yo...
分类:其他好文   时间:2015-08-17 17:20:59    阅读次数:155
Lightoj 1112 - Curious Robin Hood 【单点修改 + 单点、 区间查询】【树状数组 水题】
1112 - Curious Robin Hood PDF (English) Statistics Forum Time Limit: 1 second(s) Memory Limit: 64 MB Robin Hood likes to loot rich people since he helps the p...
分类:编程语言   时间:2015-08-17 17:17:00    阅读次数:148
LightOJ 1132 Summing up Powers(矩阵快速幂+二项式定理)
LightOJ 1132题意:给出N(1≤N≤1015),K(0≤K≤50);给出N (1 ≤ N ≤ 10^{15}) , K (0 ≤ K ≤ 50); 计算:(1K+2K+3K+...+NK)%232.计算:(1^K + 2^K + 3^K + ... + N^K) \% 2^{32}.思路:根据二项式定理,我们可以得到: (n+1)k=C0knk+C1knk?1+C2knk?2+...+...
分类:其他好文   时间:2015-08-17 01:14:22    阅读次数:185
LightOJ 1422 Halloween Costumes 【 区间dp 】
区间dp的第一题-----看题解看了好多~~终于看懂了---55555dp[i][j] 表示第i天到第j天至少需要多少件衣服那么第i件衣服只被第i天占用的话, dp[i][j] = dp[i+1][j] + 1如果不只被第i天占用的话,那么假设在第k天和第i天穿一样的衣服,dp[i][j] = dp...
分类:其他好文   时间:2015-08-16 22:45:57    阅读次数:118
LightOJ 1047-Program C
DescriptionThe people ofMohammadpurhave decided to paint each of their houses red, green, or blue. They've also decided that no two neighboring houses...
分类:其他好文   时间:2015-08-16 21:07:14    阅读次数:136
714条   上一页 1 ... 53 54 55 56 57 ... 72 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!