1.使用dd命令创建一个swap分区dd if=/dev/zero of=/swapfile bs=1024 count=1024k接着需要格式化新建的swap分区mkswap /swapfile结果类似下图:2.开启swap分区:swapon /swapfile如需关闭swap分区,可执行 swa...
分类:
其他好文 时间:
2015-08-10 01:37:52
阅读次数:
145
题目大意:让求n!在base进制下的位数以及末尾0的连续个数。题目分析:一个m位的b进制数N,最小是b^(m-1),最大不超过b^m,即b^(m-1)≤N# include# include# include# include# includeusing namespace std;const in...
分类:
其他好文 时间:
2015-08-09 12:11:30
阅读次数:
125
C/C++函数,比较两个字符串设这两个字符串为str1,str2,若str1==str2,则返回零;若str1>str2,则返回正数;若str1#include#include#includeusing namespace std;mapM;int main(){ M["zero"]=...
分类:
其他好文 时间:
2015-08-09 10:44:20
阅读次数:
146
多重背包+二进制优化#include#include#include#include#define maxn 100000+10using namespace std;int dp[maxn],n,k;int v[101],w[101],V;void zero(int cost){ for(i...
分类:
系统相关 时间:
2015-08-08 22:43:05
阅读次数:
221
Description
Little Susie loves strings. Today she calculates distances between them. As Susie is a small girl after all, her strings contain only digits zero and one. She uses the definition of Ham...
分类:
其他好文 时间:
2015-08-08 18:25:39
阅读次数:
117
题目Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:
Elements in a triplet (a,b,c) must be...
分类:
其他好文 时间:
2015-08-06 18:31:12
阅读次数:
95
Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The...
分类:
其他好文 时间:
2015-08-06 12:47:25
阅读次数:
120
原文链接Scala Option[T] is a container for zero or one element of a given type. An Option[T] can be eitherSome[T]orNoneobject, which represents a missing ...
分类:
其他好文 时间:
2015-08-05 18:15:03
阅读次数:
141
1 /// 2 /// 一般贝塞尔曲线 (两个控制点) 3 /// 4 public class Bezier 5 { 6 private Vector3 Start = Vector3.zero; //开始点 7 private Vector3 Star...
分类:
其他好文 时间:
2015-08-01 12:52:49
阅读次数:
153
描述: 统计给定的n个实数中,负数、零和正数的个数。代码: #include#include#include#include#include using namespace std;#define N 200int main(){ int n,neg,pos,zero; double...
分类:
其他好文 时间:
2015-08-01 11:23:00
阅读次数:
88