- 博客(177)
- 资源 (227)
- 收藏
- 关注
原创 hibernate的环境搭建
本文以hibernate来操纵mysql数据库,所以在此之前必须确保mysql数据库已经正确安装好。。。1、导hibernate包的核心jar包。。。2、导hbm.xml文件3、导hibernate.cfg.xml文件以上三个文件为hibernate环境搭建的基础材料...其可以到hibernate的官网去下载.....在这里我为大家准备好了我自己常用的版本http://d
2013-11-21 01:48:23 3678 1
转载 关于C++中cin.ignore()的问题
实际上你在每次输入数据的时候会输入一个回车 ‘\n'cin在读入整数时候会忽略空白碰到非数字('\n')时停止 cin在getline时会把'\n'及之前的内容读回来,哪怕是空行也会读入cin在读入字符时会把缓冲区内当前字符读入(不会忽略空白)cin.ignore(1000, '\n')的含义是把缓冲区内从当前字符开始知道'\n'之前字符(如果有1000个的话)忽略掉,实际上你这里假设一行
2013-11-04 11:44:37 3999 1
原创 (Relax ST1.6)POJ 1218 THE DRUNK JAILER(求1-n之间有多少个平方数)
/* * POJ_1218.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include using namespace std;int main(){ int t; scanf("%d",&t); while(t--){ int n; scanf("%d
2013-11-30 22:48:45 1608
原创 (Relax ST1.8)POJ 1517 u Calculate e(求各阶乘累加之和)
/* * POJ_1517.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include using namespace std;double rank(int n){//返回n!的倒数... double val; double mul = 1; if(n ==
2013-11-30 22:10:54 1362
原创 (Relax ST1.9)POJ 1936 All in All(判断一个字符串去掉一部分以后是否等价于另一个字符串)
/* * POJ_1936.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include #include using namespace std;const int maxn = 100005;int main(){ char str1[maxn],str2[m
2013-11-30 16:57:04 1157
原创 (Relax ST1.10)POJ 2027 No Brainer()
/* * POJ_2027.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include using namespace std;int main(){ int t; scanf("%d",&t); while(t--){ int a,b; scanf("%d%
2013-11-30 14:02:14 1427
原创 (Relax ST1.11)POJ 2159 Ancient Cipher(判断一个字符串是否是另外一个字符串的原串)
本文分析部分转载自http://blog.csdn.net/lyy289065406/article/details/6642586PS:本题稍微说一下题意(当时有点发牢骚的感觉,O(∩_∩)O哈哈~)一种我认为是比较符合现实的解题思路,但是总是Wrong Answer 咋看之下确实是被题目忽悠了,一般思路都是先对置换解密,再对乱序解密,但是题目所给出的乱序码只
2013-11-30 13:04:58 1778
原创 (Relax ST1.13)POJ 2780 Linearity(给出若干个点,求最多有多少个点共线,不能使用n^3算法)
#include #include #include #include using namespace std;const int maxn = 1010;const int inf = INT_MIN;struct Point{ int x; int y; bool operator<(const Point& b)const{//排序规则这里怎么定义都无所谓,但是一
2013-11-29 16:35:35 1750
原创 (Relax ST1.14)POJ 1118 Lining Up(与POJ 2606差不多)
#include #include using namespace std;const int maxn = 1005;struct Point{ int x; int y;}p[maxn];int main(){ int n; while(scanf("%d",&n)!=EOF){ int i; for(i = 0 ; i < n ; ++
2013-11-29 15:56:12 1140
原创 (Relax ST1.14)POJ 2656 Unhappy Jinjin
Jinjin要学习N天,学习时间分为学校时间和补课时间,如果Jinjin某天学习了超过八小时(>= 8),则Jinjin会不开心,如果他有过不开心,那么求他学习时间最长的一天(从1开始),如果有几天学习时间都最长,则输出最早的一天;如果Jinjin学习时间小于等于八小时,则输出0。/* * POJ_2656.cpp * * Created on: 2013年11月26日 *
2013-11-29 15:00:50 1226
原创 (Relax ST1.15)POJ 3175 Finding Bovine Roots
枚举:如果 x.123... 这个数字的平方是一个整数的话,那必然sqr(x.124) > ceil(sqr(x.123)) [sqr = 求平方, ceil = 向上取整]所以,就可以从小到大枚举它的整数部分 x ,遇到第一个满足结果的 x,就是答案了。 #include #include #include using namespace std;
2013-11-29 13:58:15 1322
原创 (Relax ST1.16)POJ 3589 Number-guessing Game(求连个字符串中相同的字符有多少个和同位置&&同字符的字符个数有多少个)
/* * POJ_3589.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include using namespace std;int main(){ int t; scanf("%d",&t); while(t--){ char a[10],b[10];
2013-11-29 13:33:22 1475
原创 (Relax ST1.17)POJ 3618 Exploration(求在t时间内能去n个景点中的几个)
每次一个人到离原点最近的一个景点(有正负)求最多能经过多少个景点?/* * POJ_3618.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include #include #include using namespace std;const int
2013-11-28 23:36:45 1996
原创 (Relax ST1.18)POJ 3619 Speed Reading
题意:整本书N页,k组,s页/分钟,一次持续t分钟,需休息r分钟/* * POJ_3619_1.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include using namespace std;int main() { int n, k; while (sc
2013-11-28 22:51:58 1441
原创 (Relax ST1.19)POJ 3627 Bookshelf(贪心)
问题:已知有n个人及每个人的身高,问为了达到高度b,最少需要几个人叠罗汉。保证n个人的总身高超过b。思路:先取身高最高的,如果不足b,再取剩下中最高的。先排序,再贪心。/* * POJ_3627.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include
2013-11-28 22:03:34 1691
原创 (Relax ST1.20)POJ 3663 Costume Party(贪心+剪枝)
解题报告:这道题就是让求两牛之间的距离小于等于s的个数,直接遍历找的话TLE,先利用快排从小到大排序, 再遍历同时缩小遍历的范围;/* * POJ_3663.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include #include using namespace
2013-11-28 20:56:20 1648
原创 (Relax ST1.22)POJ 3664 Election Time(两次排序的巧妙应用)
解题报告:题意就是牛的淘汰赛,规则有两轮,再第一轮中选出前k个牛,再在这k只牛中选取第二轮中票数最多的牛,输出它的编号,进行两次排序就行!/* * POJ_3667.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include #include using names
2013-11-28 19:45:06 1524
原创 (Relax ST1.27)POJ 3665 iCow(将一个数分给其他数的处理方式:整出和不整除部分)
无聊的英语阅读题:大意:1.每首歌均有其对应权值:Ri2.当前要播放的歌必须是当前所有歌曲中权值最大的一首(若最高值出现多个,则取编号最小的)3.当一首歌播放完毕时,该歌的权值平均分给其他(N-1)首歌,当前歌曲权值变为04.若3中当前歌曲的权值不能整除(N-1),则先把能整除的部分按3的要求分配,余数部分从编号1 开始每首歌曲得1分(不包括当前歌曲),直到全部分完为止。
2013-11-27 23:53:03 1146
原创 (Relax ST1.29)POJ 3672 Long Distance Racing(来回路问题..)
纯数学。对于每一个unit,同时计算来回所要的时间。有N个路段(N这里可以一边读入一边计算:每次读入一个路段,如果这个路段是上坡路或者下坡路,就把剩余时间减去U+D,否则减去2*F。如果当前时间不足就输出前一段路的编号并退出。时间复杂度是O(N)。/* * POJ_3672.cpp * * Created on: 2013年11月26日 * Author:
2013-11-27 22:28:39 1183
原创 (Relax ST1.29)POJ 3749 破译密码(将一个字符串按照一定的规则转化成另外一个字符串)
/* * POJ_3749.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include #include using namespace std;char m[500];//也可以用map来做..int main() { m['A'] = 'V', m['B']
2013-11-27 22:10:17 1107
转载 error C3861: 'round': identifier not found
本文转载自http://blog.csdn.net/hua_007/article/details/10931035error C3861: 'round': identifier not found There is no round function in for windows. Instead, you have to implement it yourself. Thi
2013-11-26 19:45:14 2614
原创 (Relax ST1.12)POJ 2606 Rabbit hunt(给出若干个点,求最多能有多少个点共线)
题意:给出n个点的整数坐标(n思路:简单几何题。采用几何中三个点是否在一条直线判定定理。/* * POJ_2606.cpp * * Created on: 2013年11月26日 * Author: Administrator */#include #include using namespace std;const int m
2013-11-26 12:03:28 1339
原创 (Relax 线段树1.4)POJ 3225 Help with Intervals
/* * POJ_3225.cpp * * Created on: 2013年11月25日 * Author: Administrator */#include #include #define maxn 140000#define Fup(i, s, t) for (int i = s; i <= t; i ++)#define Fdn(i, s, t) fo
2013-11-26 10:43:28 787
原创 (Relax ST1.7)POJ 1256 Anagram(求一个字符串在特殊规定下的全排列)
在做POJ1256时牵扯问题如下。按要求(并不是传统的字典序)排序,然后调用next_permutation即可。先说说什么是字典序:官方的定义比较复杂,其实故名思议可以想象咱们英语字典中的单词排列。举个例子如下:假设对于字符集{a,b,c}的字典序就为abcacbbacbcacabcba其实就是一个全排列,但是重点是按一定的顺序(字
2013-11-26 10:15:05 1166
原创 (Relax 线段树1.3)POJ 3667 Hotel(互不相交的线段的更新与统计)
#include #include #define maxn 80010#define Fup(i, s, t) for (int i = s; i <= t; i ++)#define Fdn(i, s, t) for (int i = s; i >= t; i --)using namespace std;struct node { int ls;//左端空区间的长度 i
2013-11-26 09:41:59 1219
转载 线段树离散化(对于数据庞大,超时,超内存时)
本文转载自http://blog.csdn.net/taotaotaotao910429/article/details/7785635数据范围很大,直接搞超时+超内存,需要离散化:第一,离散化简单的来说就是只取我们需要的值来用,比如说区间[1000,2000],[1990,2012] 我们用不到[-∞,999][1001,1989][1991,1999][2001,2011][2013,
2013-11-25 16:37:44 1033
原创 (Relax 线段树1.2)POJ 2528 Mayor's posters(计算可见线段)
/* * POJ_2528.cpp * * Created on: 2013年11月25日 * Author: Administrator */#include #include #include #define maxn 10010#define Fup(i, s, t) for (int i = s; i <= t; i ++)using namespa
2013-11-25 16:23:51 881
原创 (Relax 线段树1.1)POJ 3468 A Simple Problem with Integers(线段树子区间更新的维护:集中更新和动态统计子序列中的数据)
/* * POJ_3468.cpp * * Created on: 2013年11月25日 * Author: Administrator */#include #include #define maxn 100010#define Fup(i, s, t) for (int i = s; i <= t; i ++)#define Fdn(i, s, t) fo
2013-11-25 15:51:55 976
原创 (Relax 后缀数组1.4)POJ 2774 Long Long Message(求两个字符串公共子串的最大长度)
#include #include #include #include #include #include #define Fup(i, s, t) for (int i = s; i <= t; i ++)#define Fdn(i, s, t) for (int i = s; i >= t; i --)#define Path(i, s) for (int i = s; i
2013-11-25 11:13:31 1093
原创 (Relax 后缀数组1.3)POJ 3415 Common Substrings(求串A和串B中长度不小于k的公共子串数)
#include #include #include #include #include #include #define Fup(i, s, t) for (int i = s; i <= t; i ++)#define Fdn(i, s, t) for (int i = s; i >= t; i --)#define Path(i, s) for (int i = s; i;
2013-11-25 10:35:06 1218
原创 (Relax 后缀数组1.2)POJ 3261 Milk Patterns(求一个长度为n的整数序列中,至少出现k次的子序列的最长的长度)
【题意】给定一个长度为n的整数序列,求其中至少出现k次的子序列长度最长为多长【输入】第一行n和k接下来n个数字描述序列【输出】一个数字,表示至少出现过k次的子序列最长长度也是09年论文《后缀数组——处理字符串的有力工具》上的例题不过不同之处是二分答案之时,判断方式是一组中是否有k个后缀/* * POJ_3261.
2013-11-25 10:04:56 2587
原创 使用电脑动态显示android手机上画面的方法
方法一:使用asm.jar1、现在相应的软件asm.jar.下载链接如下:http://download.csdn.net/detail/caihongshijie6/66051012、配置jar文件的打开方式http://jingyan.baidu.com/article/200957617c3619cb0621b44d.html3、将adb.exe添加到环境变量中。
2013-11-25 00:31:18 1947
原创 ADB不是内部或外部命令解决方法
安装Android SDK以后,在CMD中运行adb命令提示:adb不是内部或外部命令,也不是可运行的程序或批量文件。出现此问题是因为未设置adb的相关环境变量,或环境变量设置错误。知道了原因,解决起来就简单了。依次打开我的电脑-属性-高级-环境变量,在系统变量中找到变量path双击打开,并在末尾添加以下内容:;D:\Android\android-sdk\platform-tools
2013-11-25 00:19:52 24648 3
原创 android手机界面动态显示到电脑
http://zhidao.baidu.com/question/309855590.html?qbl=relate_question_0
2013-11-24 23:57:01 1756
原创 (Relax 后缀数组1.1)POJ 1743 Musical Theme(后缀数组的基本使用)
/* * POJ_1743.cpp * * Created on: 2013年11月24日 * Author: Administrator */#include #include #include #include using namespace std;const int maxn = 20010;struct node{ int now; in
2013-11-24 21:34:19 1013
原创 (Relax 并查集1.1)POJ 2492 A Bug's Life(并查集的基本使用)
判断bug中是否有guy。。。。。。。。。。用n和n+max表示逻辑正反两反面,两个同一集合内的两个都小于max代表有相同,一个小于一个大于代表不同#include using namespace std;const int maxn = 10010;int pre[2*maxn];int n,m;int p1,p2;int total;int f
2013-11-24 20:43:23 1077
原创 (Relax dijkstra1.2)POJ 2263 Heavy Cargo(使用dijkstra来求解最大生成树问题)
题意:有n个城市,m条连接两个城市的道路,每条道路有自己的最大复载量。现在问从城市a到城市b,车上的最大载重能为多少。 思路:dijkstra。在松弛的地方要改一下,即当前点now的最大负载为min(dict[now], edge[now][i]),这很关键。其次输入求城市名称对应的顶点编号要注意下,然后就是赤裸裸的dij了。#include #include
2013-11-24 15:51:30 1331
原创 (Realx dijkstra1.1)POJ 1797 Heavy Transportation(使用dijkstra来解决最大生成树问题)
题目大意:有n个城市,m条道路,在每条道路上有一个承载量,现在要求从1到n城市最大承载量,而最大承载量就是从城市1到城市n所有通路上的最大承载量解题思路:其实这个求最大边可以近似于求最短路,只要修改下找最短路更新的条件就可以了#include #include #include using namespace std;const int maxn = 1100;c
2013-11-24 15:24:45 1287
git-1.8.1.3-intel-universal-snow-leopard.dmg
2015-07-17
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人