House of Representatives
#include
#include
#include
using namespace std;
typedef long long ll;
#define N 1111111
ll dp[N];
int a[N];
ll sum[N],ans[N];
struct EDGE {
int v, next;
ll...
分类:
其他好文 时间:
2015-07-14 11:38:23
阅读次数:
117
题目大意:给出n个字符串,每个字符串由大写字母组成(每个字母最多出现一次),问说找出尽量多的字符串,使得这些字符串中任意字母出现的次数均为偶数。解题思路:中间相遇法,首先如果对于一个字符串用一个二进制数来表示的话,对应选出若干个字符串既可以用这些二进制数取亦或所得到的数来表示,如果为0即为满足。中间相遇法即将n差分成两部分来枚举,当两个状态相同的话,相亦或肯定为0. 。#include <cstdi...
分类:
其他好文 时间:
2015-07-14 11:37:44
阅读次数:
110
关于词语接龙,能否把所有的单词首尾连接起来(串成一条线即可,不需要围成环)
2
6
aloha
arachnid
dog
gopher
rat
tiger
3
oak
maple
elm
为什么返回值是0;而不是 n..第一个完全可以首尾相连啊。求解答啊
#include
#include
#include
using namespace std;
vectormap[30];
int...
分类:
其他好文 时间:
2015-07-14 11:37:20
阅读次数:
126
一、代码分析
打开项目中的main.c文件(C程序的源文件拓展名为.c),可以发现它是第一个C程序中的唯一一个源文件,代码如下:
1 #include
2
3 int main(int argc, const char * argv[])
4 {
5
6 // insert code here...
7 printf("Hello, World!\n");
8...
分类:
编程语言 时间:
2015-07-14 10:09:48
阅读次数:
148
这里对于题意在说明一下, 题目中要求的排列必须是波浪形,每一个在排列中的人不是波峰就是波谷,如果它既不是波峰也不是波谷排列就是错的. 对于我这种数学渣渣来说,做一道dp题要好久,%>_ 2 #include 3 4 using namespace std; 5 6 __int64 dp[2...
分类:
其他好文 时间:
2015-07-14 10:03:46
阅读次数:
121
从dedecms官网论坛找到个合适的代码 include/inc/inc_fun_SpGetArcList.php for($i=0;$i<$ridnum;$i++){ if($tpsql=="") $tpsql .= " And ( (".TypeGetSunID($reids[$i],$dsql...
分类:
其他好文 时间:
2015-07-14 09:55:02
阅读次数:
186
#include#include#includeint index=1;typedef char String[24];String str;/*=============用于构造二叉树(存储的数据)===============*/void StrAssign(String str,char *c...
分类:
其他好文 时间:
2015-07-14 08:41:33
阅读次数:
196
实验环境:CentOS6实验需求:Nginx服务器和php-fpm服务器分开,不是在同一台服务器上需要两台服务器base,nginxbase上只安装php,php-fpm即可,而nginx上安装nginx服务而不安装php-fpmnginx的虚拟主机设置为:location~\.php${
root/var/www/;//指定工作路径(php代码放置目录)
fastcgi..
分类:
Web程序 时间:
2015-07-14 06:18:38
阅读次数:
299
//数组运算
/*
==================================================================
题目:查找数组的最大元素,并输出其位置和值!
==================================================================
*/
#include
#define M 3
#...
分类:
编程语言 时间:
2015-07-14 06:16:29
阅读次数:
132
题意:求n个数的最小公倍数
分析:用方法:lcm(a,b,c)=lcm(a,lcm(b,c))。注意先除后乘防止整数溢出(小技巧)
代码:
#include
using namespace std;
int t,n,a;
int gcd(int a,int b)
{
return b==0?a:gcd(b,a%b);
}
int main()
{
cin>>t;
while(t--){...
分类:
其他好文 时间:
2015-07-14 06:14:22
阅读次数:
145