现在位置: 首页 > exteptattax发表的所有文章
  • 09月
  • 04日
算法 ⁄ 共 1926字 评论关闭
题意:给定一棵 N (1 <= N <= 10000) 个结点的带权树,定义 dist(u, v) 为u, v 两点间的最短路径长度,路径的长度定义为路径上所有边的 权和。再给定一个 K (1 <= K <= 10^9 ) ,如果对于不同的两个结点 a, b ,如果满足 dist (a, b) <=K ,则称 (a, b) 为合法点对。求合法点的 个数。 思路:点分治。详见漆子超的《分治算法在树的路径问题中的应用》,详见代码: // file name: poj1741.cpp // // author: kereo // // create time: 2014年10月18日 星期六 16时59分24秒 // //***********************************// #......
阅读全文
  • 02月
  • 24日
综合 ⁄ 共 2056字 评论关闭
题目链接~~> 做题感悟:这题一看就知道要用状态压缩,本题和HDU 1429 胜利大逃亡(续)差不多。 解题思路:你可以把宝物压缩为二进制,例如:01001 代表你已经拿过 1 号和 4 号宝物了 0 代表相应的宝物没拿。用同样的方法把拿某个物品的前提条件也映射成二进制。假如你现在遇到 3 号宝物,如果3号宝物的前提条件是拿到 1 号 和 4 号宝物才能拿 3 号,那么前提条件可以用二进制表示为 :01001  那么只要将这个二进制与你当前的 key 相与如果结果还是等于前提条件的二进制,表示前提条件已经满足。so 3 号物品可以取走(前提是没......
阅读全文
  • 05月
  • 28日
综合 ⁄ 共 6495字 评论关闭
背景:在项目中遇到下面这个exception Exception occurred while logging on Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???];  SQL state [null]; error code [0]; An SQLException was provoked by the following failure:  com.mchange.v2.resourcepool.ResourcePoolException: Attempted to use a closed or  broken resource pool; nested exception is java.sql.SQLException: An SQLException was  provoked by the following failure: com.mchange.v2.resourcepool.ResourcePoolE......
阅读全文
  • 05月
  • 07日
综合 ⁄ 共 246字 评论关闭
1、按照条件导出: # mysqldump -u root -p dbname --no-create-db=TRUE --no-create-info=TRUE --add-drop-table=FALSE --where="id<50" tablename>/home/tablename_less50.sql;   dbname为数据库名,tablename为表明,--where=后的内容为导出条件。 2、导出到平面文件: SELECT id,name FROM orders INTO OUTFILE '/tmp/abc';
阅读全文
  • 04月
  • 28日
综合 ⁄ 共 2493字 评论关闭
A - Concatenation of Languages Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Practice UVA 10887 Appoint description:  System Crawler  (2015-03-01) Description Problem A Concatenation of Languages Input File: Standard Input Output: Standard Output   A language is a set of strings. And the concatenation of two languages is the set of all strings that are formed by concatenating the strings of the second language at the end of the strings......
阅读全文
  • 04月
  • 27日
综合 ⁄ 共 4872字 评论关闭
纯C代码下读写BMP文件代码,简单易懂。   /**//***************************************************************  Copyright (c) 2007, Shanghai **  **  文件名称:read_write_bmp_with_C.c**  编译:    Visual C++  / ANSI C / ISO C++**    日期:    2007.10.24**************************************************************/#include "stdio.h"#include "stdlib.h"#define PIXPLINE  320typedef struct tagRGBQUAD...{     //定义每个像素的数据类型        unsigned char  rgbBlue;        unsigned char  rgbGreen;   ......
阅读全文
  • 03月
  • 31日
综合 ⁄ 共 1375字 评论关闭
    在main.xml中:   <LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent">   <com.li.paintproject.MyView       android:layout_width="fill_parent"       android:layout_height="wrap_content"/> </LinearLayout>           在MyPaintDemo.java中:   package com.li.paintproject;   import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.vi......
阅读全文
Problem Description A while ago it was quite cumbersome to create a message for the Short Message Service (SMS) on a mobile phone. This was because you only have nine keys and the alphabet has more than nine letters, so most characters could only be entered by pressing one key several times. For example, if you wanted to type "hello" you had to press key 4 twice, key 3 twice, key 5 three times, again key 5 three times, and finally key 6 three times. This procedure is very tedious and kee......
阅读全文
  • 02月
  • 17日
综合 ⁄ 共 3588字 评论关闭
package Rw.Dialog; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; public class Dialog01Activity extends Activity { private Button button1,button2,button3,button4,button6,button......
阅读全文
  • 02月
  • 08日
综合 ⁄ 共 7317字 评论关闭
由于TeeChart VCL 版本广泛应用于多种开发环境并得到很好的认可,西班牙Steema Software SL公司于1997年10月又开发了TeeChart Pro ActiveX。对于B/S的开发模式无疑是一个好消息,由于它只需安装在服务器端,客户端无需安装其他软件,只要使用通用浏览器即可显示统计图形,因此一面市更是又一次得到极大的欢迎。        下面我们结合ASP技术介绍一下TeeChart Pro V5 ActiveX组件常用属性及应用。        我们先来看一个以TeeChart组件来显示"季度销售量"情况的二维柱状图实例: <HTML><BODY> <%’-----------TeeCha......
阅读全文
  • 02月
  • 06日
综合 ⁄ 共 427字 评论关闭
1、输入由一串字符,由数字和英文字母组成,求输出左边为数字,右边为英文字母。 解题思路:利用快速排序的一趟快排过程。 #include<stio.h> #include<string.h> int main(){ int i,j,len; int low,high; char str[1000]; while(scanf("%s",str+1)!=EOF){ len=strlen(str+1); low=0; high=len; str[0]='*'; while(low<high){ while((!('0'<=str[high]&&str[high]<='9'))&&low<high){ high--; } str[low]=str[high]; while((('0'<=str[low]&&s......
阅读全文
  • 01月
  • 28日
综合 ⁄ 共 306字 评论关闭
用el表达式的写法如下,其中employee保存在服务器作用域中,如session,注意红色字体部分: <select name="employee_sex">       <option value="男" ${employee.employee_sex=="男"?"selected":""}>男</option>       <option value="女" ${employee.employee_sex=="女"?"selected":""}>女</option> </select> checkbox类似,只是把selected改成checked ${employee.employee_sex=="男"?"checked":""}
阅读全文