随笔分类 -  OJ

n皇后问题的递归和迭代版 leetcode N-Queens
摘要:题目如下图: 递归版 迭代版 阅读全文

posted @ 2016-09-16 11:26 lakeone 阅读(834) 评论(0) 推荐(0)

leecode之Implement strStr()
摘要:KMP算法的实现:#include #include #include int strStr(char* haystack, char* needle) { if (haystack == NULL || needle == NULL) return -1; if (nee... 阅读全文

posted @ 2015-05-29 11:02 lakeone 阅读(225) 评论(0) 推荐(0)

UVA 160 - Factors and Factorials
摘要:Factors and FactorialsThe factorial of a numberN(writtenN!) is defined as the product of all the integers from 1 toN. It is often defined recursively ... 阅读全文

posted @ 2014-12-07 21:18 lakeone 阅读(645) 评论(0) 推荐(0)

Uva 642 - Word Amalgamation sort qsort
摘要:Word AmalgamationIn millions of newspapers across the United States there is a word game calledJumble. The object of this game is to solve a riddle, b... 阅读全文

posted @ 2014-12-06 20:45 lakeone 阅读(447) 评论(0) 推荐(0)

UVA OJ 10035 - Primary Arithmetic
摘要:Primary ArithmeticChildren are taught to add multi-digit numbers from right-to-left one digit at a time. Many find the "carry" operation - in which a ... 阅读全文

posted @ 2014-11-24 20:25 lakeone 阅读(264) 评论(0) 推荐(0)

UVa OJ 455 Periodic Strings
摘要:Periodic StringsA character string is said to have periodkif it can be formed by concatenating one or more repetitions of another string of lengthk. F... 阅读全文

posted @ 2014-11-24 19:50 lakeone 阅读(318) 评论(0) 推荐(0)

导航