1、$position = index(string,substring,skipchars);
该函数返回子串substring在字符串string中的位置,如果不存在,则返回-1;参数skipchars是可选参数,表示查找之前跳过的字符数,即:从该位置处开始查找;2、rindex(string,...
分类:
其他好文 时间:
2014-05-26 08:22:13
阅读次数:
234
之前使用过cocos2d-x获取系统时间,毫秒级的
[cpp] view
plaincopy
long getCurrentTime()
{
struct timeval tv;
gettimeofday(&tv,NULL);
return tv.tv_sec * 10...
分类:
其他好文 时间:
2014-05-26 05:37:49
阅读次数:
358
Problem Description
Everybody knows any number can be combined by the prime number.
Now, your task is telling me what position of the largest prime factor.
The position of prime 2 is 1, prime 3 is ...
分类:
其他好文 时间:
2014-05-26 04:29:14
阅读次数:
371
UVA 10843 - Anne's game
题目链接
题意:题意说得挺绕的,其实本质上就是求n个点,可以接连出多少种不同的生成树
思路:这是Caylay定理,网上能找到证明,结果为nn?2,然后利用快速幂去求解。
代码:
#include
#include
const int long long MOD = 2000000011;
int t;
long long n;...
分类:
其他好文 时间:
2014-05-26 03:36:35
阅读次数:
278
Elegant String
题意:给定一个字符串,由0-k数字组成,要求该串中,子串不包含0-k全排列的方案数
思路:dp[i][j]表示放到i个数字,后面有j个不相同,然后想递推式,大概就是对应每种情况k分别能由那几种状态转移过来,在纸上画画就能构造出矩阵了,由于n很大,所以用快速幂解决
代码:
#include
#include
const long long MOD = ...
分类:
其他好文 时间:
2014-05-25 00:36:34
阅读次数:
211
http://poj.org/problem?id=2449
大致题意:给出一个有向图,求从起点到终点的第K短路。
K短路A*算法讲解:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define LL long...
分类:
其他好文 时间:
2014-05-24 23:39:47
阅读次数:
352
首先,在之前,我不是一个 Python玩家,我只是一个使用者,需要即取,现在,我要认真学习和记录,正确称为一个Python的玩家。
说明,这明显不是教程,是我自己理解并记录的笔记而已。
Python有五个标准的数据类型:
Numbers(数字)String(字符串)List(列表)Tuple(元组)Dictionary(字典)
数字有四种数值类型:int,long ,float...
分类:
编程语言 时间:
2014-05-24 23:07:59
阅读次数:
387
【题目】
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine if you are able to reach the last index.
For example:...
分类:
其他好文 时间:
2014-05-24 20:44:39
阅读次数:
221
唉! 有用的拿去吧。 直接可以用。 1 package com.tai.use; 2 3 import
java.text.SimpleDateFormat; 4 5 public class DataUtil 6 { 7 /** 8 * 时间格式转换,将字...
分类:
其他好文 时间:
2014-05-24 12:47:52
阅读次数:
439
1 package com.tai.use; 2 3 import
java.text.DateFormat; 4 import java.text.SimpleDateFormat; 5 import
java.util.Calendar; 6 import java.util.Date; 7.....
分类:
其他好文 时间:
2014-05-24 11:51:15
阅读次数:
302