/*
这道题类似于八数码难题,基本思想是宽搜,使用Hash判重。如果使用一般的八维数组空间可以达到8^8=16777216,
会超过USACO的16MB空间限制。所以我们应该对状态进行散列存储,观察发现每位的数字不能重复,
存在空间冗余。我们可以对于每个状态建立一个映射,采用康托展开算法。(参见Nocow) 定义cantor(s)为s串大大小顺序。
可样将哈希容量缩减到8!=40320。
另外发...
分类:
其他 时间:
2014-03-01 05:48:21
收藏:
0 评论:
0 赞:
0 阅读:
447
/*
Main idea:
Use SPFA(i) to compute the shortest paths from single source i;
i is in [1..P], P is the number of pastures; and then compute the total
distance of paths each cow to source i;
SPFA m...
分类:
其他 时间:
2014-03-01 04:27:42
收藏:
0 评论:
0 赞:
0 阅读:
487
/*
Main idea
Find Euler Path, not circuit, so take care to choose a start node whose
degree is odd;
*/
/*
Executing...
Test 1: TEST OK [0.000 secs, 3512 KB]
Test 2: TEST OK [0.000 secs, 3512 KB...
分类:
其他 时间:
2014-03-01 06:01:39
收藏:
0 评论:
0 赞:
0 阅读:
537
/*
Main idear
DP problem. Take each offer as a single choise for DP.
dp[a1][a2][a3][a4][a5] = min{dp[a1-prodcut_num[i][1]][a2-prodcut_num[i][2]]
[a1-prodcut_num[i][3]][a1-prodc...
分类:
其他 时间:
2014-03-01 04:43:41
收藏:
0 评论:
0 赞:
0 阅读:
482
/*
Main Idea;
dist[x1][y1][x2][y2] denote the knight's min move from (x1,y1) to (x2,y2);
king_move_num[x][y] denote the king's min move from its initial place to the
square it meet a knight.We can co...
分类:
其他 时间:
2014-03-01 04:23:10
收藏:
0 评论:
0 赞:
0 阅读:
471
Author:DriverMonkey
Mail:bookworepeng@Hotmail.com
Phone:13410905075
QQ:196568501
本文资料主要来自互联网,并通过本人亲测试正确性
How to use GPIO signals
Contents
[hide]
1 Referenc...
分类:
其他 时间:
2014-03-01 05:07:17
收藏:
0 评论:
0 赞:
0 阅读:
679
在上一篇的博客敏捷开发之道(六)计划(续)中我们介绍了一下敏捷开发的计划和简单的执行,接下来我们针对在开发中不可避免的测试进行一下介绍。...
分类:
其他 时间:
2014-03-01 06:48:47
收藏:
0 评论:
0 赞:
0 阅读:
432
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1423
Problem Description
This is a problem from ZOJ 2432.To make it easyer,you just need output the length of the subsequence.
Input
Each se...
分类:
其他 时间:
2014-03-01 05:56:58
收藏:
0 评论:
0 赞:
0 阅读:
530
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace C03LSP
{
class Program
{
static void Main(string[...
分类:
其他 时间:
2014-03-01 04:43:11
收藏:
0 评论:
0 赞:
0 阅读:
501
首先说一句,大神就不用看了,这都是最基础的知识。
先看一个sql语句
select distinct name from user u1 where (select count(*) from user u2 where u1.name=u2.name)>3
这句话是选出user表中name字段相同的名字出现三次以上的name。
这句话的语义到底应该怎么分析呢?
在MYSQL中(对其...
分类:
其他 时间:
2014-03-01 04:46:37
收藏:
0 评论:
0 赞:
0 阅读:
456
在XML解析和使用原始XML资源中都涉及过对XML的解析,之前使用的是DOM4J和XmlResourceParser
来解析的。本文中将使用XmlPullParser来解析,分别解析不同复杂度的test1.xml、test2.xml、test3.xml。代码如下:
MainActivity:
package com.home.xmlparsetest;
import java.io.I...
分类:
其他 时间:
2014-03-01 06:28:20
收藏:
0 评论:
0 赞:
0 阅读:
476
在做毕业设计的时候,遇到了用复选框来显示数据库中的信息,但是数量不能确定。因此,需要减低程序显示时和数据库的耦合度,让程序自己可以根据数据库的记录的信息数量变化自动适应。基于该需求用到了动态生成控件。还是和之前一样,知识内容都是一样的,只是在使用的细节上的区别。
需求
根据数据窗口中符合要求的数据库记录数和内容动态的创建复选框控件,放置于Tab control控件上。这样就可以很灵活的...
分类:
其他 时间:
2014-03-01 05:06:47
收藏:
0 评论:
0 赞:
0 阅读:
541
Enviroment:
system platform : OS 10.8.5
Python:2.7
The first method I've tried : failed
using MacPorts : " It can be installed by typing the following command: sudo port
install py-s...
分类:
其他 时间:
2014-03-01 05:56:26
收藏:
0 评论:
0 赞:
0 阅读:
449
1、启动ArcMap,加载栅格数据DEM
2、在ArcToolbox中打开“山体阴影”(或Hillshade)工具,输入数据源选择DEM图层,其他参数默认
3、单击“确定”,生成新的栅格数据图层sw_usa_dem
4、在内容列表中,右键单击sw_usa_dem图层,选择“属性”
5、打开图层属性窗口,切换到Display页,设置图层透明度,比如设置为35%
...
分类:
其他 时间:
2014-03-01 05:34:27
收藏:
0 评论:
0 赞:
0 阅读:
611
算法基础(二):栈的应用--迷宫解题(超详细版!)。(注:为了不离开本节讨论的重点--栈,迷宫的自动生成以后重新写。这里用简单的二维数组代替,手动迷宫,呵呵!)
MAP里面0代表墙(通不过),1代表空格(可通过)代码中每一步有详细注释。欢迎大家交流,嘻嘻。...
分类:
其他 时间:
2014-03-01 04:18:04
收藏:
0 评论:
0 赞:
0 阅读:
492
浅拷贝(Shallow Copy)与深拷贝(Deep Copy),它们是什么?
1.浅拷贝(Shallow Copy)=(bitwise copy:位元逐一复制,按位拷贝)指的是拷贝对象而不拷贝该对象包含的对象,对它的嵌套的对象,仅拷贝其句柄。
2.深拷贝(Deep Copy)指在拷贝对象的时候连同拷贝它所包含的对象。
简单的说
通俗...
分类:
其他 时间:
2014-03-01 05:03:06
收藏:
0 评论:
0 赞:
0 阅读:
475
http://acm.hdu.edu.cn/showproblem.php?pid=1838
题意:有一个n*n的棋盘,问其中满足题意的棋盘规模(正方形)最大是多少,以及它的个数。要求棋盘右下角必须是黑色。
思路:还没来得及思考,学姐把思路讲了大半,就直接按那个思路敲的。dp[i][j]表示以(i,j)为右下角所含棋盘的最大规模,
如果 s[i][j] == s[i-1][j-1] ...
分类:
其他 时间:
2014-03-01 05:55:29
收藏:
0 评论:
0 赞:
0 阅读:
519
/*
* name :tuzuoquan mail :tuzq@css.com.cn date :2014/02/14 version :0.1
* description:气象信息共享门户系统通用JS,TreeTable CopyRight (C) 2014-02
*/
// 获取选中一行的情况,下面的一个参数可以代表一个DataGrid
function getSelected...
分类:
其他 时间:
2014-03-01 04:50:44
收藏:
0 评论:
0 赞:
0 阅读:
726
在struts.xml中,本来敲入
1.找到struts-2.3.16-all类库,在struts-2.3.16-all -> bin目录下找到struts-core-1.3.10.jar文件,解压到一个文件夹(struts-core-1.3.10)中;
2.在Struts.xml的前几行代码中找到 http://struts.apache.org/dtds/struts-2.3.dtd ...
分类:
其他 时间:
2014-03-01 06:27:14
收藏:
0 评论:
0 赞:
0 阅读:
360
设置当前的纹理函数:
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
void glTexEnvf (GLenum target, GLenum pname, GLfloat param);
//target必须是GL_TEXTURE_FILTER_CONTROL或GL_TEXTURE_ENV
//如...
分类:
其他 时间:
2014-03-01 05:39:36
收藏:
0 评论:
0 赞:
0 阅读:
791