将整数一个字符一个字符地读入,再转成整数,比直接作为整数读入快。在读入大规模的整数数据时比较有效。代码如下:inline void read_int(int &num){ char c; while (c = getchar(), c '9'); num = c - '0'; whil...
分类:
其他好文 时间:
2014-07-30 23:20:45
阅读次数:
507
引言今天在群里看到分享的解决死锁的sql语句,就想着这东西以后肯定用的着,就下载下来,在这里记录一下,以后查找也方便。SQL 1 SET QUOTED_IDENTIFIER ON 2 GO 3 SET ANSI_NULLS ON 4 GO 5 CREATE PROCEDURE sp_who_lock...
分类:
数据库 时间:
2014-07-30 23:16:55
阅读次数:
488
//code:#include#includeusing namespace std;typedef int status;typedef int elemType;typedef struct lNode{elemType num;struct lNode *next;}lNode,*linkNo...
分类:
其他好文 时间:
2014-07-30 23:13:45
阅读次数:
189
递归#include #include #include #define NUM 4int total = 0;void print_board(int *board){ printf("\n"); for (int i = 0; i < NUM; i++) { fo...
分类:
其他好文 时间:
2014-07-30 20:20:54
阅读次数:
188
总时间限制: 2000ms 内存限制: 65536kB描述John is going on a fishing trip. He has h hours available (1 = 0 ), is known. Each 5 minutes of fishing decreases the num...
分类:
其他好文 时间:
2014-07-30 20:10:54
阅读次数:
270
解决方案:1、查看:ps-ef|grepyumroot31601014:47?00:00:00/usr/bin/python-tt/usr/sbin/yum-updatesdroot33403160014:47?00:00:00/usr/bin/python-tt/usr/libexec/yum-updatesd-helper--check--dbusroot34583374014:56pts/100:00:00grepyum2、kill31603340(kill掉相关进程,..
分类:
移动开发 时间:
2014-07-30 17:52:04
阅读次数:
282
题目链接:FATE
状态转移方程:
dp[ren][num] =max(dp[ren-耐久值][num-1]+ 经验值,dp[ren][num])
dp表示:当前忍耐度ren下杀敌数为num的经验值
枚举分别枚举 所有怪物种类、耐久度、杀怪数
最后在从小到达枚举消耗的耐久度即可
#include
#include
#include
#include
#inclu...
分类:
其他好文 时间:
2014-07-30 17:27:34
阅读次数:
176
跟线性数组和链表不同,HashTable是快速查找的数据结构。本文中的HashTable使用链表处理数组。
该HashTable可以指定table的长度,提供了遍历的方法。包括table的长度的选择也比较讲究。
cp_int32 nPrime[MAX_HASH_PRIME_ARRAY_NUM] = {
17,
37,
79,
163,
331,
673,
1361
};
就是说table的长度来取自上面这个数组。比如用户设定了200,那么ta...
分类:
移动开发 时间:
2014-07-30 17:26:14
阅读次数:
380
什么是可中断的锁获取呢?就是:线程在等待获取锁的过程中,是否能够响应中断,以便在被中断的时候能够解除阻
塞状态,而不是傻傻地一直在等待。java对象的内置锁(synchronized)就是一种不可中断的锁,也就是说如果一个线
程在等待获取某个对象的内置锁,就算是该线程被其他线程中断,该线程仍然继续等待内置锁,而不是解除阻塞状
态,也不会抛出InterruptedException。Lock类...
分类:
编程语言 时间:
2014-07-30 14:49:43
阅读次数:
254
# include
# include
# include
# include
using namespace std;
int max(int a,int b)
{
return a>b?a:b;
}
int main()
{
int T,n,t,k,m,i,hh,min,id,num,x;
int last[1010];//最后一次开始炒饭的时间
int cot[1010];/...
分类:
其他好文 时间:
2014-07-30 14:45:53
阅读次数:
164