[Question]
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 t...
分类:
其他好文 时间:
2014-05-07 05:37:44
阅读次数:
278
题目链接: SCUT 2014
题目大意: 判断给出的字符串中是否是正确的科学计数法
A+1.5Be+8C,可以是实数或者含有指数的实数,ABC三个部分表示空格,可有可无,正负号可有可无
指数部分只能是整数
解题思路: 建立有穷自动机状态转移表,一共是10种状态...
分类:
其他好文 时间:
2014-05-07 05:32:27
阅读次数:
330
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4722
思路:数位dp,dp[i][j]表示到第i位,数字和%10为j,然后进行dp,注意完全匹配的情况是要+1,而其他情况是从0 到 9 都要考虑
代码:
#include
#include
#include
#include
using namespace std;
int t;
l...
分类:
其他好文 时间:
2014-05-07 04:55:37
阅读次数:
314
题目链接:
http://poj.org/problem?id=2773
Happy 2006
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 9131
Accepted: 3073
Description
Two positiv...
分类:
移动开发 时间:
2014-05-07 02:37:49
阅读次数:
435
1,可以用route命令临时修改:
route add default gw
2, 通过修改/etc/sysconfig/network 文件永久修改:
脚本:
#!/bin/sh
#configure default gw
# $1 is ip of gateway
defgw=$1
sed -i "s/NETWORKING.*/NETWORKING=yes/" /et...
分类:
其他好文 时间:
2014-05-06 23:37:22
阅读次数:
374
Sys.Application.add_load(function() {
var form = Sys.WebForms.PageRequestManager.getInstance()._form;
form._initialAction = form.action = window.location.href;
});
if (!documen...
分类:
Web程序 时间:
2014-05-06 23:36:38
阅读次数:
408
Beaming NDEF Messages to Other Devices
Android Beam allows simple peer-to-peer data exchange between two Android-powered devices. The application that wants to beam data to another device must be in ...
分类:
移动开发 时间:
2014-05-06 23:21:48
阅读次数:
620
【题目】
原文:
1.4 Write a method to decide if two strings are anagrams or not.
译文:
写一个函数判断两个字符串是否是变位词。
【分析】
变位词(anagrams)指的是组成两个单词的字符相同,但位置不同的单词。比如说, abbcd和abcdb就是一对变位词。该题目有两种思路:
【思路一】
由于变位词只是字...
分类:
其他好文 时间:
2014-05-06 23:17:56
阅读次数:
383
n个数,只能用
F[i][j]=(F[i-1][j]+F[i-1][j-1])*j
F[i][j]代表i个数,有j个不同值的情况。比如A
大数模板
#include
#include
const int MAX =505;
struct BigNum
{
int num[MAX];
int len;
} a[51][51];
BigNum Add(...
分类:
其他好文 时间:
2014-05-06 23:06:51
阅读次数:
364
ubuntu12.04服务器可以使用apt-get方式安装NodeJS,但是,安装完后的版本为v0.6.12的版本,如果我们想要使用新一点的版本需要做如下配置:apt-getinstallpython-software-properties
apt-add-repositoryppa:chris-lea/node.js
apt-getupdate
apt-getinstallnodejs安装完成后可以..
分类:
Web程序 时间:
2014-05-06 16:45:52
阅读次数:
378