随笔分类 - 算法与数据结构
摘要:Huge Fibonacci Numbers时间限制: 1 Sec 内存限制: 128 MB题目描述A Fibonacci sequence is calculated by adding the previous two membersof the sequence, with the first two members being both 1. f(1) = 1, f(2) = 1, f(n > 2) = f(n - 1) + f(n - 2)Your task is to take a number as input, and print that Fibonacci numbe
阅读全文
摘要:Substitution CypherTime Limit: 1.0 Seconds Memory Limit: 65536K Multiple test files Substitution cyphers are the simplest of cyphers where the letters of one alphabet are substituted for the letters of another alphabet. In one form or another, they've been in use for over 2000 years. Input A lin
阅读全文
摘要:题目描述 Given a string containing only "A"-"Z", we could encode it using the following method:We use 3 characters to represent a sub-string if there are some consecutive repeating characters in one line, which "0" is as the mark, and then the repeat number , and the charac
阅读全文
摘要:RT,上数据结构课时写的, 注释后面再补上. 上课时, 听得不是很认真, 先放在这里, 等后面再来慢慢理解. 使用时, 首先会创建根结点, 依次创建左孩子, 左孩子. 输入0表示该结点为空. 创建左/右孩子的时候, 又把左/右孩子当作根结点, 递归创建属于它们的左右孩子.#include...
阅读全文