Permutation p is
an ordered set of integers p1,??p2,??...,??pn,
consisting of n distinct positive integers, each of them doesn't exceed n.
We'll denote the i-th element of permutation p as pi.
...
分类:
其他好文 时间:
2014-07-22 23:00:15
阅读次数:
312
XMPP/Smack/Openfire javax.net.ssl.SSLException:
Received fatal alert:
internal_error解决:1、在链接openfire服务器后,线程休眠一段时间,再进行登录login操作。connection.connect();Th...
分类:
其他好文 时间:
2014-05-10 19:39:25
阅读次数:
349
Problem DescriptionGiven n integers.You have two
operations:U A B: replace the Ath number by B. (index counting from 0)Q A B:
output the length of the...
分类:
其他好文 时间:
2014-05-06 01:20:33
阅读次数:
332
typeof:typeof是一个一元运算符,放在一个运算数之前。"boolean"---如果这个值是布尔值。"string"---如果这个值是字符串。"number"---如果这个值是数值。"undefined"---如果这个值未定义。"object"---如果这个值是对象(包括Number,Str...
分类:
其他好文 时间:
2014-05-06 00:55:25
阅读次数:
698
Say you have an array for which theithelement
is the price of a given stock on dayi.Design an algorithm to find the maximum
profit. You may complete a...
分类:
其他好文 时间:
2014-05-06 00:51:29
阅读次数:
353
Given a binary tree containing digits from 0-9
only, each root-to-leaf path could represent a number.An example is the
root-to-leaf path 1->2->3 which...
分类:
其他好文 时间:
2014-05-05 23:55:36
阅读次数:
407
题目:大意就是猜数,给定个四位数,然后给出这个数与正确的数之间的比较(#A*B,#代表有#个数字他的值和位置都对了,*代表有*个数的值对了),给出n个上述的4位数,让你确定这个正确的数是多少。
思路:直接暴力。
注意:程序结束是n为负数,而不是-1,为此超时了两次 T T。
代码:
#include
#include
#include
using namespace std;
str...
分类:
其他好文 时间:
2014-05-02 21:16:30
阅读次数:
314
原题链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1416
结论题,具体判断方法请点击这个网址。
筛素数是肯定的,但一开始定的范围太大了,想当然要筛到10^9的质数,但仔细想想,只要到sqrt(10^9)就可以了,最后的那一个质数是最...
分类:
其他好文 时间:
2014-05-02 13:41:45
阅读次数:
448
16、Power digit sum215= 32768 and the sum of its
digits is 3 + 2 + 7 + 6 + 8 = 26.What is the sum of the digits of the number
21000?题目大意:215= 32768 并且其...
分类:
其他好文 时间:
2014-05-02 13:17:49
阅读次数:
1223