array_merge() 函数把两个或多个数组合并为一个数组。 例子 1 <?php
$a1=array("a"=>"Horse","b"=>"Dog");
$a2=array("c"=>"Cow","b"=>"Cat");
print_r(array_merge($a1,$a2));
?> 输出: Array?(?[a]?=>?Hor...
分类:
Web程序 时间:
2014-07-22 08:37:34
阅读次数:
187
部分和问题
描述给定整数a1、a2、.......an,判断是否可以从中选出若干数,使它们的和恰好为K。
输入首先,输入n,表示数的个数。
接着一行n个数。
(1
下一行输入k,表示数的和
输出如果和恰好可以为k,输出“YES”,并按输入顺序依次输出是由哪几个数的和组成,否则“NO”
样例输入
4
1 2 4 7
13
样例输出
YE...
分类:
其他好文 时间:
2014-07-21 23:45:54
阅读次数:
193
Maximum sumTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d
& %I64u
SubmitStatus
Description
Given a set of n integers: A={a1, a2,..., an}, we define a function d(A) as belo...
分类:
其他好文 时间:
2014-07-21 16:43:54
阅读次数:
257
#include
#include
#include
#include
#include
using namespace std;
int h[20][20];
int v[20][20];
int size_[20];
int n,m;
int flag;
void judge(int x,int y)//这是关键部分的代码,用来判读那是否能构成square;
{
int a1=n-x...
分类:
其他好文 时间:
2014-07-21 13:36:09
阅读次数:
221
简约不简单的ngx_strlow() 函数,不错的形参设计方式。 1.如果本人设计ngx_strlow()函数会怎么写? 2.ngx_strlow函数形参相比本人的 写法有什么优势? A1.本人写法如下 #define?my_tolower(c)?(char)(((c)?>=?...
分类:
其他好文 时间:
2014-07-21 13:28:20
阅读次数:
206
1282. 修路 Description 蹦蹦跳跳结束后,cxt回头看看自己走过的路坑坑洼洼的,心中非常不爽,他表示要把这段路的路面高度修成单调上升的或者单调下降的,整条路可以看成 N段,N个整数A1,…..,An(1<=n<=2000)依...
分类:
其他好文 时间:
2014-07-21 10:32:06
阅读次数:
719
UVA 10870 - Recurrences
题目链接
题意:f(n) = a1 f(n - 1) + a2 f(n - 2) + a3 f(n - 3) + ... + ad f(n - d), for n > d.
已知前d项求第n项
思路:矩阵快速幂,对应矩阵为
|a1 a2 a3 ... ad|
|1 0 0 ... 0 0 0|
|0 1 0 ... 0 0 ...
分类:
其他好文 时间:
2014-07-21 09:30:29
阅读次数:
211
Problem Description
Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in...
分类:
其他好文 时间:
2014-07-20 23:01:28
阅读次数:
271
#include
#include
#include
char s[250];
char a[10][250];
int a1[4];
int a2[250];
char ch;
int init(int len)
{
int tt=0;
for(int i=1;i<=7;i++)
{
for(int j=0;j<(int)pow(2,i)-1;j++)
...
分类:
其他好文 时间:
2014-07-20 10:25:18
阅读次数:
185
总Time Limit:
10000ms
Memory Limit:
65536kB
有一个神奇的口袋,总的容积是40,用这个口袋可以变出一些物品,这些物品的总体积必须是40。John现在有n个想要得到的物品,每个物品的体积分别是a1,a2……an。John可以从这些物品中选择一些,如果选出的物体的总体积是40,那么利用这个神奇的口袋,John就可以得到这些物品。现在...
分类:
其他好文 时间:
2014-07-19 23:14:09
阅读次数:
222