现在位置: 首页 > doves发表的所有文章
  • 08月
  • 21日
综合 ⁄ 共 1271字 评论关闭
Ellipse Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 876    Accepted Submission(s): 280 Problem Description Math is important!! Many students failed in 2+2’s mathematical test, so let's AC this problem to mourn for our lost youth.. Look this sample picture: A ellipses in the plane and center in point O. the L,R lines will be vertical through the X-axis. The problem is calculating the blue intersection area. But calculating th......
阅读全文
  • 10月
  • 13日
综合 ⁄ 共 3041字 评论关闭
HDU 3416 Marriage Match IV 题目链接 题意:给一个有向图,给定起点终点,问最多多少条点可以重复,边不能重复的最短路 思路:边不能重复,以为着每个边的容量就是1了,最大流问题,那么问题只要能把最短路上的边找出来,跑一下最大流即可,判断一条边是否是最短路上的边,就从起点和终点各做一次dijstra,求出最短路距离后,如果一条边满足d1[u] + d2[v] + w(u, v) == Mindist,那么这条边就是了 代码: #include <cstdio> #include <cstring> #include <queue> #include <algorithm> using names......
阅读全文
  • 05月
  • 25日
综合 ⁄ 共 130字 评论关闭
#include "stdio.h" #define f(x) x*x int main(void) {    int i; i=f(4+4)/4; printf("%d",i); return 0; }   输出为21   #define为宏替换 i=4+4*4+4/(2+2)=21
阅读全文
  • 05月
  • 15日
综合 ⁄ 共 1356字 评论关闭
RAID磁盘阵列设备,在使用过程中,经常会遇到一些常见故障,这也使得RAID在给我们带来海量存储空间的应用之外,也带来了很多难以估计的数据风险。本文将重点介绍RAID常见故障及相关处理方式。 RAID故障注意事项 1、数据丢失后,用户千万不要对硬盘进行任何操作,将硬盘按顺序卸下来,用镜像软件将每块硬盘做成镜像文件,也可以交给专业数据恢复中心进行。 2、不要对Raid卡进行Rebuild操作,否则会加大恢复数据的难度。 3、标记好硬盘在Raid卡上面的顺序。 4、一旦出现问题,可以拨打专业数据恢复中心的咨询电话找专业工程师进行咨......
阅读全文
  • 04月
  • 07日
综合 ⁄ 共 644字 评论关闭
1. 概念:保证一个类仅有一个实例,并提供一个访问它的全局访问点。 2. UML图: 3.代码: (1)懒汉模式:只有在自身需要的时候才会创建。运行时获得对象,它在整个应用的生命周期只有一部分时间在占用资源。 public class Singleton {   private static Singleton singletonInstance;   private Singleton() //私有的构造方法   {   }   public static synchronized Singleton GetInstance()   {     if (singletonInstance == null)     {       singletonInstance = new Singleton(); ......
阅读全文
  • 03月
  • 20日
综合 ⁄ 共 0字 评论关闭
  • 01月
  • 17日
综合 ⁄ 共 393字 评论关闭
#include <iostream> #include <algorithm> using namespace std; int a[] = { 1, -2, 3, 10, -4, 7, 2, -5 }; int opt[20]; int main(void) { memset(opt, 0, sizeof(opt)); int maxv = -1; int rhs, lhs; opt[0] = a[0]; for(int i = 1; i < 8; ++i) opt[i] = max(a[i], a[i] + opt[i-1]); for(int j = 0; j < 8; ++j) { if(maxv < opt[j]) { maxv = opt[j]; rhs = j; } } cout << a[rhs] <<endl; for(lhs = rhs; lhs >= 0; --lhs) { if(opt[lhs] < ......
阅读全文
  • 01月
  • 14日
综合 ⁄ 共 1980字 评论关闭
Strategic Game Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3714    Accepted Submission(s): 1630 Problem Description Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend a medieval city, the roads of which form a tree. He has to put the minimum number of soldiers on the nodes so that they ca......
阅读全文
iOS提供了拍击、旋转、滑动、挤捏等丰富的手势,因此对图像的操作就显得非常友好、简单。下面代码展示了使用UIGestureRecognizer对图像进行缩放、移动、旋转操作使用方法。 在使用代码之前,首先建立一个UIView,并在该视图中增加一个UIImageView视图,用于展示图像。那么该UIView就类似图像画板一样,对图像的操作都基于此视图中进行。 在视图中创建手势识别器UIGestureRecognizers - (void)viewDidLoad { [super viewDidLoad]; UIPinchGestureRecognizer *pinchRecognizer = [[[UIPinchGestureRecognizer alloc] initWi......
阅读全文
  • 11月
  • 08日
综合 ⁄ 共 1140字 评论关闭
  多个线程操作相同的数据时,一般是需要按顺序访问的,否则会引导数据错乱,无法控制数据,变成随机变量。为解决这个问题,就需要引入互斥变量,让每个线程都按顺序地访问变量。这样就需要使用EnterCriticalSection和LeaveCriticalSection函数。 函数EnterCriticalSection和LeaveCriticalSection声明如下:   WINBASEAPI   VOID   WINAPI   EnterCriticalSection(   __inout LPCRITICAL_SECTION lpCriticalSection   );   WINBASEAPI   VOID   WINAPI   LeaveCriticalSection(   __inout LPCRIT......
阅读全文
  • 10月
  • 31日
综合 ⁄ 共 76字 评论关闭
控制小键盘及键盘灯状态 来自: http://blog.csdn.net/cceczjxy/archive/2008/06/25/2584796.aspx
阅读全文
  • 10月
  • 26日
综合 ⁄ 共 643字 评论关闭
 Route命令公有print add delete和change四个子命令. print用于显示路由表中的路由信息,add用于向路由表中增加一条路由信息,delete用于从路由表中删除一条路由信息,change用于修改路由表中已存在的路由信息.  a) Route print 在命令行下面输入route print然后回车即可,该命令共有网卡列表、活动路由与默认网关、持久路由三项输出  b) Route add 格式为:route add 目的IP mask 掩码网关iP metric 度量值 if 网卡编号 例如:我们这里增加一条通过网卡1,经过网关16.100.0.1,到达子网掩码为255.255.255.128的IP地址为16.100.0.0的子网......
阅读全文