上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 27 下一页

2016年2月4日

[2016-02-04][HDU][1053][Entropy]

摘要: [2016-02-04][HDU][1053][Entropy]EntropyTime Limit: 1000MSMemory Limit: 32768KB64bit IO Format: %I64d & %I64uSubmit StatusDescriptionAn entropy encoder is a data encoding method that achieves lossless ... 阅读全文

posted @ 2016-02-04 22:33 红洋 阅读(199) 评论(0) 推荐(0)

[2016-02-04][POJ][1328][Radar Installation]

摘要: [2016-02-04][POJ][1328][Radar Installation]Radar InstallationTime Limit: 1000MSMemory Limit: 10000KB64bit IO Format: %I64d & %I64uSubmit StatusDescriptionAssume the coasting is an infinite straight li... 阅读全文

posted @ 2016-02-04 22:20 红洋 阅读(172) 评论(0) 推荐(0)

[2016-02-04][HDU][2037][今年暑假不AC]

摘要: [2016-02-04][HDU][2037][今年暑假不AC]今年暑假不ACTime Limit: 1000MSMemory Limit: 32768KB64bit IO Format: %I64d & %I64uSubmit StatusDescription“今年暑假不AC?” “是的。” “那你干什么呢?” “看世界杯呀,笨蛋!” “@#$%^&*%...” 确实如此,世界杯来了,球迷的节... 阅读全文

posted @ 2016-02-04 21:28 红洋 阅读(137) 评论(0) 推荐(0)

[2016-02-04][HDU][1009][FatMouse' Trade]

摘要: [2016-02-04][HDU][1009][FatMouse' Trade] FatMouse' Trade Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Submit Status Descrip 阅读全文

posted @ 2016-02-04 21:13 红洋 阅读(133) 评论(0) 推荐(0)

[2016-02-03][KMP算法]

摘要: [2016-02-03][KMP算法]123456789101112131415161718192021222324252627282930313233const int maxn = 1E5 + 10;const int maxm = 1E4 + 10;int next[maxm];int kkk[maxn];void makenext(char P[]){ //m p中的元素的数... 阅读全文

posted @ 2016-02-04 00:59 红洋 阅读(160) 评论(0) 推荐(0)

[2016-02-04][HDU][3746][Cyclic Nacklace]

摘要: [2016-02-04][HDU][3746][Cyclic Nacklace]时间:2016-02-04 00:14:53 星期四题目编号:HDU 3746题目大意:给出一个字符串,把字符串补成循环的字符串,至少需要多少补充多少字符,方法:kmp1234567891011121314151617181920212223242526272829303132333435363738394041424... 阅读全文

posted @ 2016-02-04 00:42 红洋 阅读(156) 评论(0) 推荐(0)

[2016-02-04][HDU][1711][Number Sequence]

摘要: 时间:2016-02-03 23:55:12 星期三题目编号:HDU 1711题目大意:给定两个序列,q1,q2,输出q2在q1的位置(第一个数字对应的位置,不存在输出-1)分析:kmp方法:kmp处理,p2完全匹配的时候返回解题过程遇到问题: next数组重定义,CENumber SequenceTime Limit: 5000MSMemory Limit: 32768KB64bit IO... 阅读全文

posted @ 2016-02-04 00:10 红洋 阅读(196) 评论(0) 推荐(0)

2016年2月3日

[2016-02-03][ACM][滚动数组][位运算]

摘要: [2016-02-03][ACM][滚动数组][位运算][长度只有2,使用位运算更加快速]滚动数组,如果长度只有2,使用位运算更加快速123456789101112#includeusing namespace std;int main(){ int a[2]; //使用cur作下标表示,使用 ^位运算,比使用 %取模运算更快 int cur = 1; ... 阅读全文

posted @ 2016-02-03 23:00 红洋 阅读(283) 评论(0) 推荐(0)

[2016-02-03][UVA][514][Rails]

摘要: 时间:2016-02-03 22:24:52 星期三题目编号:UVA 514题目大意:给定若干的火车(编号1-n),按1-n的顺序进入车站,给出火车出站的顺序,问是否有可能存在分析: FIFO,用栈模拟一遍即可,方法: 根据输入的顺序,从1-n开始,当前操作的为i如果i是当前对应的编号,那么直接跳过(进入B)如果不是,根据当前需求的编号,小于i,就从栈顶弹出一个元素,看这个元素是否是需... 阅读全文

posted @ 2016-02-03 22:50 红洋 阅读(140) 评论(0) 推荐(0)

2016年1月27日

[2016-01-27][树的直径]

摘要: [2016-01-27][树的直径]随机取一个顶点,跑一次dfs ,得到当前点能走到的最远的顶点 ,k再从k 跑一遍dfs ,得到的最远的顶点qk和q之间的距离,就是树的直径12345678910111213141516171819202122232425void dfs(int cur, int ct){ int k = 0; int size = v[cur].size(); ... 阅读全文

posted @ 2016-01-27 23:35 红洋 阅读(111) 评论(0) 推荐(0)

上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 27 下一页

导航