摘要: Colossal Fibonacci Numbers! UVA - 11582 The i’th Fibonacci number f(i) is recursively defined in the following way: • f(0) = 0 and f(1) = 1 • f(i + 2) 阅读全文
posted @ 2017-10-07 19:12 ikefire 阅读(304) 评论(0) 推荐(0)
摘要: 1.大整数取模 把大整数写成“自左向右”的形式:1234=((1*10+2)*10+3)*10+4;然后逐步取模。 eg:n<=10100,m<=1018。但是要注意乘法溢出的问题。 代码: 为了解决上面乘法溢出的问题,可以采用如下方法: 2.F快速幂 大致意思是给出三个数n,m,p。他们的范围是0 阅读全文
posted @ 2017-10-07 14:54 ikefire 阅读(331) 评论(0) 推荐(0)
摘要: 敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 100935 Accepted Submission(s): 42687 Problem 阅读全文
posted @ 2017-10-05 10:04 ikefire 阅读(138) 评论(0) 推荐(0)
摘要: 模板:前序,中序,后序遍历。 代码: 题目:Tree Walk Binary trees are defined recursively. A binary tree T is a structure defined on a finite set of nodes that either cont 阅读全文
posted @ 2017-09-20 13:50 ikefire 阅读(823) 评论(0) 推荐(0)
摘要: 一个概念: C++ STL - stack 代码: 今天也是元气满满的一天!good luck! 阅读全文
posted @ 2017-09-17 15:47 ikefire 阅读(304) 评论(0) 推荐(0)
摘要: 栈(stack)是限定仅在表尾进行插入和删除操作的线性表,允许插入和删除的一端称为栈顶(top),另一端称为栈底(bottom),不含任何数据元素的栈称为空栈。 栈又称为后进先出(LastIn First Out)的线性表,简称LIFO结构。 栈元素具有线性关系,即前驱后继关系。只不过它是一种特殊的 阅读全文
posted @ 2017-09-17 09:59 ikefire 阅读(814) 评论(0) 推荐(0)
摘要: The cows have run out of hay, a horrible event that must be remedied immediately. Bessie intends to visit the other farms to survey their hay situatio 阅读全文
posted @ 2017-09-15 19:26 ikefire 阅读(153) 评论(0) 推荐(0)
摘要: Sum Problem Time Limit: 1000/500 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 488812 Accepted Submission(s): 124145 阅读全文
posted @ 2017-09-13 20:48 ikefire 阅读(122) 评论(0) 推荐(0)
摘要: N! Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 84139 Accepted Submission(s): 24802 Problem 阅读全文
posted @ 2017-09-13 11:51 ikefire 阅读(146) 评论(0) 推荐(0)
摘要: 题解:后续的功能会不定期更新 emmm框架: 代码: 今天也是元气满满的一天!good luck! 阅读全文
posted @ 2017-09-10 19:07 ikefire 阅读(547) 评论(1) 推荐(0)