题目
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the targe...
分类:
其他 时间:
2015-08-16 02:08:47
收藏:
0 评论:
0 赞:
0 阅读:
168
2049: [Sdoi2008]Cave 洞穴勘测
Time Limit: 10 Sec Memory Limit: 259 MB
Submit: 4698 Solved: 2107
[Submit][Status][Discuss]
Description
辉辉热衷于洞穴勘测。某天,他按照地图来到了一片被标记为JSZX的洞穴群地区。经过初步勘测,辉辉发现这片区域由n个洞穴(分别...
分类:
其他 时间:
2015-08-16 02:08:17
收藏:
0 评论:
0 赞:
0 阅读:
176
bool ISprime(int n)
{
int i,isqrt=(int)sqrt(n);
if(n
return (n==2);
else if(n%2==0)
return false;
else
for(i=3;i
if(n%i==0){
return false;
}
}
return true;
}
/*
#include
是素数返回tru...
分类:
其他 时间:
2015-08-16 02:08:07
收藏:
0 评论:
0 赞:
0 阅读:
125
威尔逊定理
在初等数论中,威尔逊定理给出了判定一个自然数是否为素数的充分必要条件。即:当且仅当p为素数时:(
p -1 )! ≡ -1 ( mod p ),但是由于阶乘是呈爆炸增长的,其结论对于实际操作意义不大。
hdu5391用到了这一数论定理。
Zball in Tina Town
Time Limit: 3000/1500 MS (Java/Others) Me...
分类:
其他 时间:
2015-08-16 02:07:48
收藏:
0 评论:
0 赞:
0 阅读:
319
使用OpenJTAG烧写:(裸板程序)
1、安装驱动
2、将 oflash.exe FTD2XX.dll 拷贝到 C:\Windows\system32 下。(oflash.exe 和 FTD2XX.dll 在 百问网JZ2440v2主光盘\windows\tools中)
3、然后在 Windows 命令行就可以直接使用了。
4、接线。
5、在命令 Windows 命令行中使用 oflas...
分类:
其他 时间:
2015-08-16 02:07:27
收藏:
0 评论:
0 赞:
0 阅读:
191
字符串拼接strcatchar *mystrcat(char *dest,const char *source)
{
char *pstart = dest;
while (*pstart != '\0')
{
pstart++;
}
//从尾部
while ((*pstart++)=(*source++))
{
}
}
void main()
{
char str1[22]...
分类:
其他 时间:
2015-08-16 02:07:17
收藏:
0 评论:
0 赞:
0 阅读:
148
$ vim /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network in...
分类:
其他 时间:
2015-08-16 02:07:08
收藏:
0 评论:
0 赞:
0 阅读:
188
字符查找函数strchr
char *mystrchr(const char *str, const char c)
{
char *p = NULL;
for (char*newp = str; *newp != '\0'; newp++)
{
if (*newp==c)
{
p = newp;//一个一个的查找
break;
}
}
return p;
}
...
分类:
其他 时间:
2015-08-16 02:06:47
收藏:
0 评论:
0 赞:
0 阅读:
185
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
cat /Users/you/.ssh/id_rsa.pub, 将此公钥文件内容添加到gitlab的ssh中;
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR EMAI...
分类:
其他 时间:
2015-08-16 02:06:37
收藏:
0 评论:
0 赞:
0 阅读:
177
今天下载了一个Linux内核文件,解压的时候出现了这样的错误: gzip:stdin:unexpectedendoffile tar:UnexpectedEOFinarchive tar:UnexpectedEOFinarchive tar:Errorisnotrecoverable:exi...
分类:
其他 时间:
2015-08-16 02:05:47
收藏:
0 评论:
0 赞:
0 阅读:
167
本文借鉴葡萄城空间产品,纯属分享,无任何营利目的下载ActiveReports 9 专业版打开下面的网站,点击立即下载,请您填写真实电子邮件地址,以获取ActiveReports产品试用版---系统会自动把下载URL发送到邮箱。http://www.gcpowertools.com.cn/produ...
分类:
其他 时间:
2015-08-16 02:05:30
收藏:
0 评论:
0 赞:
0 阅读:
831
将a从小到大排序可以得到最优解,设f[i][j]表示前i个用了j种颜色的最小累计误差,则f[i][j]=min(f[k-1][j-1]+w(k,i))。其中w(k,i)为[k,i]区间里所有数与中位数的差值的绝对值之和,有w(k,i)=w(k+1,i)+a[(k+i+1)>>1]-a[k]。时间复杂...
分类:
其他 时间:
2015-08-16 02:05:17
收藏:
0 评论:
0 赞:
0 阅读:
139
转载请注明出处:http://www.cnblogs.com/fraud/ ——by fraudHow Many Sets ITime Limit:2 Seconds Memory Limit:65536 KBGive a set S, |S| =n, then how many ordered s...
分类:
其他 时间:
2015-08-16 02:05:07
收藏:
0 评论:
0 赞:
0 阅读:
123
转载请注明出处:http://www.cnblogs.com/fraud/ ——by fraudHow Many Sets IIITime Limit:2 Seconds Memory Limit:65536 KBGiven a setS= {1, 2, ...,n}, your job is to...
分类:
其他 时间:
2015-08-16 02:04:47
收藏:
0 评论:
0 赞:
0 阅读:
283
转载请注明出处:http://www.cnblogs.com/fraud/ ——by fraudBloodsuckerTime Limit:2 Seconds Memory Limit:65536 KBIn 0th day, there aren-1people and 1 bloodsucker....
分类:
其他 时间:
2015-08-16 02:04:37
收藏:
0 评论:
0 赞:
0 阅读:
154
一般切换分支需要先提交,如果本地工作还不完善,但必须切换到另一分支修BUG,你可以考虑使用下面的Git命令:git stash # 暂存git stash list # 列所有stashgit stash apply # 恢复暂存的内容git stash drop # 删除暂存区git stash ...
分类:
其他 时间:
2015-08-16 02:04:08
收藏:
0 评论:
0 赞:
0 阅读:
153
问题描述Tina Town 是一个善良友好的地方,这里的每一个人都互相关心。Tina有一个球,它的名字叫zball。zball很神奇,它会每天变大。在第一天的时候,它会变大11倍。在第二天的时候,它会变大22倍。在第nn天的时候,它会变大nn倍。zball原来的体积是11。Tina想知道,zball...
分类:
其他 时间:
2015-08-16 02:03:57
收藏:
0 评论:
0 赞:
0 阅读:
250
题意:good element的定义是a[i]在1~i-1中任取三个数(可以重复)的和能等于a[i]思路:vis[x]标记一下任两个数的和,处理a[i]时枚举1~i-1判断vis[a[i] - a[j]]是否被标记 1 #include 2 #include 3 #include 4 #inc...
分类:
其他 时间:
2015-08-16 02:03:37
收藏:
0 评论:
0 赞:
0 阅读:
246
今晚BC的一道题,用JAVA写的,但正解并不是这个这里主要是拿了一个读入优化的模板,存一下,或许以后能用到呢。 还没有进行太多的测试,以后有机会再测吧。这是这个题。 1 import java.io.*; 2 import java.util.*; 3 import java.math.*; 4 ....
分类:
其他 时间:
2015-08-16 02:03:17
收藏:
0 评论:
0 赞:
0 阅读:
139
转载请注明出处:http://www.cnblogs.com/fraud/ ——by fraudIce ClimberTime Limit:2 Seconds Memory Limit:32768 KBMaybe many one have played or at least heard ofTh...
分类:
其他 时间:
2015-08-16 02:02:47
收藏:
0 评论:
0 赞:
0 阅读:
250