1.设$1 \le p \le q \le +\infty$,证明$l^p \subset l^q$。证明:$\forall x=(x_1,x_2,\ldots) \in l^p$,$\forall \varepsilon >0$,恒存在自然数N,使得$\sum_{k=N}^{+\infty}{||...
分类:
其他好文 时间:
2015-06-03 21:06:01
阅读次数:
441
A. Soldier and Bananas
题意:第一个香蕉要kk刀,第二个2k2k刀,第ii个要i?ki*k刀。现有nn刀,问可以买几个香蕉。
题解:等差数列求和,我们知道只需要找到pp使得∑i=1pi?k≤n<∑i=1p+1i?k\sum_{i=1}^{p}i*k \le n \lt \sum_{i=1}^{p+1}{i*k}即可,移项就可以得到公式,同时上述求和公式是单调递增的,因此也可以二...
分类:
其他好文 时间:
2015-06-03 17:50:05
阅读次数:
119
#第一题就餐问题
defcheck_lunch(num,time,input):
foriinrange(num):
if((i+1)%time!=0andinput[i]!=(i+1)%time):
input[i]=0
elif((i+1)%time==0andinput[i]!=time):
input[i]=0;
returninput
num=11;
#第二题输入联想
defauto_complete(str,tmp):
arr=str.split(‘‘)
n=le..
分类:
编程语言 时间:
2015-06-02 15:27:29
阅读次数:
176
Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 10724Accepted: 3980DescriptionChildren are taught to add multi-digit numbers from right-to-le...
分类:
其他好文 时间:
2015-06-01 09:27:36
阅读次数:
105
#include
using namespace std;
void Merge_Sort(int *a,int p,int q ,int r)//归并
{
int i,j,k;
int n1=q-p+1;
int n2=r-q;
int *le=NULL;
int *ri=NULL;
le = new int [...
分类:
编程语言 时间:
2015-05-27 19:08:13
阅读次数:
113
1脚本如下[root@ipvs~]#vim99.sh
#!/bin/bash
#9*9table
#2015.5.26byluzhi
foriin{1..9}
do
forjin{1..9}
do
if[$j-le$i]
then
c=$(($i*$j))
echo-e-n"$j*$i=$c\t"
fi
done
echo""
done2运行效果
分类:
系统相关 时间:
2015-05-27 01:08:12
阅读次数:
523
思路:保存数字中一个值和次数,当遍历到下个数字时,如果和保存数字相同次数加1,否则次数减1,当次数为0,则保存下一个数字,并把次数设为1,因为要找的数字次数超过一半,那么最后一个保存的数字一定就是要找的数字。public class MoreThanHalfNum {
/**
* 需找次数超过一半数字
* @param nums
* @param le...
分类:
编程语言 时间:
2015-05-24 11:38:40
阅读次数:
103
Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le...
分类:
编程语言 时间:
2015-05-23 21:16:50
阅读次数:
170
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
编程语言 时间:
2015-05-23 10:03:37
阅读次数:
114
同其他语言一样,循环同样是shell中的脚本句型一。语法:while[表达式]do操作......done只要[]中的表达式成立则会继续循环下去。注意[]和表达式之间要有空格。流程是先判断表达式中的为ture还是false。在while的表达式中数值的比较分别为:eq:相当于=;ge:相当于>=;le:相..
分类:
系统相关 时间:
2015-05-22 19:31:26
阅读次数:
167