public class Solution { public int climbStairs(int n) { if(n==1) return 1; if(n==2) return 2; int pre=1; int cur=2; ...
分类:
其他好文 时间:
2014-07-27 23:21:39
阅读次数:
382
状态压缩 动态规划DP[111.....1]=1表示所有鱼都在的几率为10代表已经挂了的,1代表没挂;#include "stdio.h"#define max 10;i--){ int bit=bitcount(i); if(bit==1)continue; double p=2*dp[i]...
分类:
其他好文 时间:
2014-07-27 23:19:49
阅读次数:
316
#include #include using namespace std; #define max 100010 int a[max],b[max]; bool cmp(int a,int b){ return a>n){ for(int i=0;i>a[i]; b[i]=a[i]; ...
分类:
其他好文 时间:
2014-07-27 23:18:59
阅读次数:
438
1 根据句柄长度判断操作系统是否为64位操作系统public static bool IsRunningOn64Bit { get { return IntPtr.Size == 8; } }2根据句柄长度判断操作系统是否为64位操作系统(不安全代码)public static unsafe boo...
分类:
其他好文 时间:
2014-07-27 23:10:39
阅读次数:
226
Binding到DataGrid的时候,需要用到ObservableCollection. public ObservableCollection Customers { get { return ...
分类:
其他好文 时间:
2014-07-27 23:01:19
阅读次数:
222
#includeint main(){ int a,b,c; int x; scanf("%d%d%d",&a,&b,&c); for(x=10;x100) { printf("No answer\n"); }return 0;}
分类:
其他好文 时间:
2014-07-27 22:22:29
阅读次数:
180
#include#includeint main(){ int n; int a,b,r; int p,t; scanf("%d",&n); while(n--) { scanf("%d %d",&a,&b); if(a<b) { t=a; a=b...
分类:
其他好文 时间:
2014-07-27 22:21:19
阅读次数:
186
前几天遇到一个有意思的问题,实现strlen 不考虑线程安全:下面是我的实现:1 size_t strlen(const char* s)2 {3 const char* p = s;4 while (*p++);5 return p-1-s;6 }Glibc 2.19 的实...
分类:
其他好文 时间:
2014-07-27 22:00:49
阅读次数:
274
import Foundation//1.函数的定义与调用//以 func 作为前缀,返回箭头 -> 表示函数的返回类型func sayHello(name: String) -> String { let greeting = "Hello " + name + "!" return ...
分类:
其他好文 时间:
2014-07-27 21:58:29
阅读次数:
344
题目:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't....
分类:
编程语言 时间:
2014-07-27 21:28:05
阅读次数:
228