随笔分类 -  打ACM的岁月

摘要:A. Karen and Morning time limit per test 2 seconds memory limit per test 512 megabytes A. Karen and Morning time limit per test 2 seconds time limit p 阅读全文
posted @ 2017-06-18 10:09 gaoyanliang 阅读(260) 评论(0) 推荐(0)
摘要:C. Sagheer and Nubian Market time limit per test 2 seconds memory limit per test 256 megabytes C. Sagheer and Nubian Market time limit per test 2 seco 阅读全文
posted @ 2017-06-12 21:57 gaoyanliang 阅读(339) 评论(0) 推荐(0)
摘要:B. Sagheer, the Hausmeister time limit per test 1 second memory limit per test 256 megabytes B. Sagheer, the Hausmeister time limit per test 1 second 阅读全文
posted @ 2017-06-12 19:08 gaoyanliang 阅读(388) 评论(0) 推荐(0)
摘要:RMQ算法,是一个快速求区间最值的离线算法,预处理时间复杂度O(n*log(n)),查询O(1),所以是一个很快速的算法。 当然这个问题用线段树同样能够解决,算法复杂度为:O(N)~O(logN) 。 RMQ: RMQ(Range Minimum/Maximum Query),即区间最值查询,是指这 阅读全文
posted @ 2017-06-06 09:21 gaoyanliang 阅读(8018) 评论(1) 推荐(4)
摘要:求解最长回文串之Manachar算法 问题类型: 输入一个字符串,求出其中最大的回文子串。子串的含义是:在原串中连续出现的字符串片段。 回文的含义是:正着看和倒着看相同,如abba和yyxyy。 这类问题对于一些小数据可以暴力枚举回文的中心点求解(处理好奇数和偶数长度的回文即可) 但是时间复杂度较高 阅读全文
posted @ 2017-06-03 19:10 gaoyanliang 阅读(2081) 评论(0) 推荐(1)
摘要:吉哥系列故事——完美队形II Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Problem Description 吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前, 阅读全文
posted @ 2017-06-03 18:40 gaoyanliang 阅读(295) 评论(0) 推荐(0)
摘要:Best Reward Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description After an uphill battle, General Li wo 阅读全文
posted @ 2017-06-03 18:25 gaoyanliang 阅读(403) 评论(0) 推荐(0)
摘要:B. Password time limit per test 2 seconds memory limit per test 256 megabytes B. Password time limit per test 2 seconds time limit per test 2 seconds 阅读全文
posted @ 2017-05-31 18:35 gaoyanliang 阅读(542) 评论(0) 推荐(0)
摘要:#1015 : KMP算法 #1015 : KMP算法 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。 这一天,他们遇到了一只河蟹,于是河蟹就向小H 阅读全文
posted @ 2017-05-30 21:49 gaoyanliang 阅读(425) 评论(0) 推荐(0)
摘要:A + B for you again Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description Generally speaking, there are 阅读全文
posted @ 2017-05-30 17:33 gaoyanliang 阅读(247) 评论(0) 推荐(0)
摘要:Cyclic Nacklace Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description CC always becomes very depressed 阅读全文
posted @ 2017-05-30 17:16 gaoyanliang 阅读(168) 评论(0) 推荐(0)
摘要:Count the string Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description It is well known that AekdyCoin 阅读全文
posted @ 2017-05-30 16:14 gaoyanliang 阅读(223) 评论(0) 推荐(0)
摘要:Period Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description For each prefix of a given string S with N 阅读全文
posted @ 2017-05-30 16:00 gaoyanliang 阅读(220) 评论(0) 推荐(0)
摘要:时间限制:1000ms 单点时限:1000ms 内存限制:64MB 时间限制:1000ms 单点时限:1000ms 内存限制:64MB 描述 小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。 这一天,他们遇到了一连串的字符串, 阅读全文
posted @ 2017-05-29 16:41 gaoyanliang 阅读(249) 评论(0) 推荐(0)
摘要:从头到尾彻底理解KMP 从头到尾彻底理解KMP 1. 引言 本KMP原文最初写于2年多前的2011年12月,因当时初次接触KMP,思路混乱导致写也写得混乱。所以一直想找机会重新写下KMP,但苦于一直以来对KMP的理解始终不够,故才迟迟没有修改本文。 然近期因开了个算法班,班上专门讲解数据结构、面试、 阅读全文
posted @ 2017-05-29 16:19 gaoyanliang 阅读(872) 评论(1) 推荐(0)
摘要:C. Do you want a date? 2 seconds 256 megabytes C. Do you want a date? 2 seconds 256 megabytes Leha decided to move to a quiet town Vičkopolis, because 阅读全文
posted @ 2017-05-28 00:36 gaoyanliang 阅读(429) 评论(0) 推荐(1)
摘要:A. Vladik and Courtesy 2 seconds 256 megabytes A. Vladik and Courtesy 2 seconds 256 megabytes At regular competition Vladik and Valera won a and b can 阅读全文
posted @ 2017-05-27 23:51 gaoyanliang 阅读(202) 评论(0) 推荐(0)
摘要:D. Minimum number of steps time limit per test 1 second memory limit per test 256 megabytes D. Minimum number of steps time limit per test 1 second ti 阅读全文
posted @ 2017-05-25 16:20 gaoyanliang 阅读(503) 评论(0) 推荐(1)
摘要:C. Find Amir time limit per test 1 second memory limit per test 256 megabytes C. Find Amir time limit per test 1 second time limit per test memory lim 阅读全文
posted @ 2017-05-25 11:31 gaoyanliang 阅读(224) 评论(0) 推荐(0)
摘要:B. Summer sell-off time limit per test 1 second memory limit per test 256 megabytes B. Summer sell-off time limit per test 1 second time limit per tes 阅读全文
posted @ 2017-05-24 13:32 gaoyanliang 阅读(397) 评论(0) 推荐(0)