给出一个数字n,计算从1到n能组成几个不同的三角形。 n的范围是10^6,大概就是递推吧。从F[i-1]到F[i]可以线性求出。要注意结果超出int。 #include <cstdio> #include <cstring> #include <algorithm> using namespace
分类:
其他好文 时间:
2016-01-30 02:29:40
阅读次数:
156
Digit Counting Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu Submit Status Description Download as PDF Trung is bored with his
分类:
其他好文 时间:
2016-01-29 11:36:14
阅读次数:
430
试题描述 有一个大小为M*N的园子,雨后积起了水。八连通的积水被认为是连接在一起的。请求出园子里共有多少水洼?(八连通指的是下面图中相对W的*的部分)****W****限制条件:N,M≤100 输入 第一行包含两个正整数 N 和 M,表示将一个园子地面分成N*M块方格,N 行,M列,接下来的 N 行
分类:
其他好文 时间:
2016-01-28 17:21:41
阅读次数:
101
The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. F...
分类:
其他好文 时间:
2016-01-25 22:57:11
阅读次数:
491
题目大概就是求一个n个不同的数能构造出几种形态的二叉排序树。和另一道经典题目n个结点二叉树不同形态的数量一个递推解法,其实这两个问题的解都是是卡特兰数。dp[n]表示用n个数的方案数转移就枚举第几个数作为根,然后分成左右两子树,左右两子树的方案数又是相似子问题另外就是题目得先找到[1,1e10]的p...
分类:
其他好文 时间:
2016-01-25 21:14:57
阅读次数:
347
题目链接:点击打开链接#include #include using namespace std;typedef long long ll;ll re;vector p;void dfs(int dep, int g) { if (dep == 0) return ; if (p[dep-1] =....
分类:
其他好文 时间:
2016-01-21 15:46:22
阅读次数:
140
ARC (Automatic Reference Counting) 编译器自动在适当的时候给代码添加retain/release方法,而不需要程序员自己添加 与java垃圾回收机制的区别: java由系统在适当的时候自动回收空闲空间,而xcode由编译器回收MRC(Manul Refer...
分类:
其他好文 时间:
2016-01-17 18:59:42
阅读次数:
136
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Automatic_Reference_Counting_in_Delphi_Mobile_Compilers#Weak_ReferencesWeak ReferencesAnother impo...
分类:
其他好文 时间:
2016-01-16 19:07:38
阅读次数:
121
ARC在OC里面个人感觉又是一个高大上的牛词,在前面Objective-C中的内存管理部分提到了ARC内存管理机制,ARC是Automatic Reference Counting—自动引用计数。有自动引用计数,那么就得有手动引用计数MRC(Mannul Reference Counting),前面...
分类:
其他好文 时间:
2016-01-03 17:31:43
阅读次数:
206
ARC automatic Reference Counting 自动引用计数 ARC 编译器特性 编译器会在适当时候,加入内存管理的代码 强指针:默认所有的指针都是强指针 只要是有强指针指向一个对象,那么这个对象就不会被释放 只要是没有强...
分类:
其他好文 时间:
2016-01-03 13:00:56
阅读次数:
161