现在位置: 首页 > rhymntity发表的所有文章
  • 02月
  • 14日
综合 ⁄ 共 3833字 评论关闭
A and B are preparing themselves for programming contests. The University where A and B study is a set of rooms connected by corridors. Overall, the University has n rooms connected by n - 1 corridors so that you can get from any room to any other one by moving along the corridors. The rooms are numbered from 1 to n. Every day А and B write contests in some rooms of their university, and after each contest they gather together in the same room and discuss problems. A and B want the dista......
阅读全文
  • 01月
  • 14日
综合 ⁄ 共 49字 评论关闭
 杀毒软件:Macfee Enterprise 8.5 虚拟机工具:Virtual PC 2007 Beta 1
阅读全文
  • 12月
  • 22日
综合 ⁄ 共 875字 评论关闭
多重背包模板~ #include <stdio.h> #include <string.h> int a[7]; int f[100005]; int v, k; void ZeroOnePack(int cost, int weight) { for (int i = v; i >= cost; i--) if (f[i - cost] + weight > f[i]) f[i] = f[i - cost] + weight; } void CompletePack(int cost, int weight) { for (int i = cost; i <= v; i++) if (f[i - cost] + weight > f[i]) f[i] = f[i - cost] + weight; } void MultiplePack(int cost, int weight, int amount) ......
阅读全文
  • 06月
  • 10日
综合 ⁄ 共 4090字 评论关闭
作者:朱清 更新时间: 2005-05-11         将从迷宫入口到各点的最短路近的集合看作一棵树。用广度遍历  的方法即可找到出口的最短路近。本程序算法思想来源于求图上一点  到其余各点最短路近的Dijkstra算法。  /* 迷宫探路III(最短路径)*//* DIJKSTRAMAZE.C *//* 2003-8-26 */#include <stdlib.h>#include <time.h>#include <math.h>#include <stdio.h>#include <graphics.h>#define N 22#define M 22int bg[M][N];int aa[M][N];struct pace{    int pre;    int x;    int y;   ......
阅读全文
  • 05月
  • 28日
综合 ⁄ 共 6090字 评论关闭
本文实例,运行于 MySQL 5.0 及以上版本。 MySQL 赋予用户权限命令的简单格式可概括为: grant 权限 on 数据库对象 to 用户 一、grant 普通数据用户,查询、插入、更新、删除 数据库中所有表数据的权利。 grant select on testdb.* to common_user@'%' grant insert on testdb.* to common_user@'%' grant update on testdb.* to common_user@'%' grant delete on testdb.* to common_user@'%' 或者,用一条 MySQL 命令来替代: grant select, insert, update, delete on testdb.* to common_user@'%' 二、grant 数据库开发人......
阅读全文
  • 05月
  • 27日
综合 ⁄ 共 893字 评论关闭
如今网上一些字处理软件大多带有监测剪贴板功能,这个功能对于网虫特别实用,免去了IE和记事本之间来回切换的烦恼。其实要实现这个功能其实也很简单,下面就以DELPHI为例,介绍一下实现这个功能的方法。   首先新建一个工程,并在表单上加入一个MEMO控件,一个TIMER控件,设置TIMER控件的INTERVAL属性为100。具体代码如下:   unit Unit1;   interface   uses   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls,clipbrd;   type   TForm1 = class(TForm)   Memo1:......
阅读全文
官方解析 http://kb.parallels.com/cn/115026/ 适用于: Parallels Desktop 9 for Mac Parallels Desktop 8 for Mac Parallels Desktop 7 for Mac 问题 您升级 Windows 虚拟机到 Windows 8 时会面临 Parallels Tools 相关的问题: 您收到以下错误信息: Windows 无法访问 \\psf\Home\Desktop (Windows cannot access \\psf\Home\Desktop) 融合 (Coherence) 查看模式不可用无法运行 Parallels Tools 其它功能无法实现 原因 您可能是由 Windows XP、Windows Vista 或 Windows 7 升级到该系统但是没有选择迁......
阅读全文
  • 02月
  • 15日
综合 ⁄ 共 329字 评论关闭
代码如下: #encoding=utf-8 print '中国' #在Unicode和普通如ANSI编码之间转化 ustr=u'abc' ustr2=u'abc中国' #一 unicode 转换为普通字符串 print ustr.encode('ascii') #print ustr2.encode('ascii') # 这个失败 包含ascii表示不了的字符 print ustr2.encode('utf-8') #二 普通字符串转换为unicode print unicode('abc') print 'abc中国'.decode('utf-8') print type('abc中国'.decode('utf-8')) 打印结果如下: 中国 abc abc中国 abc abc中国 <type 'unicode'>
阅读全文
  • 02月
  • 04日
综合 ⁄ 共 2618字 评论关闭
在Silverlight2里面,提供了TextBox的水印WaterMark功能。但是之后的版本就把这个功能给删了。关于Silverlight2里面的水印功能可以参考这篇文章《一步一步学Silverlight 2系列(2):基本控件》。之后想用水印唯有自己写一个了。 以下是我自己写的一个带水印的TextBox。 1.新建类MyTextBox,继承TextBox。 2.在MyTextBox类里面,增加一个属性WaterMarkText用来保存水印。 除了增加一个属性之外,还需要增加一些保存区别于正常状态的属性的全局变量。 private Brush _redColor = new SolidColorBrush(Colors.Red); private doubl......
阅读全文
  • 01月
  • 26日
综合 ⁄ 共 657字 评论关闭
Python语言: Codee#24529 01 # -*- coding: cp936 -*-02 #monta cola蒙特卡洛方法算PI03 #younger.x.shen@gmail.com04 #2011/12/080506 import random0708 def getThePi(randsum):0910     inner = 0.011     outer = 0.01213     for i in range(randsum) :14         temp1 = random.random()15         temp2 = random.random()1617         if temp1 ** 2 + temp2 ** 2 <= 1 :18             inner += 11920     perc = inner / randsum21     print(inner)22     circle = 4 * perc23     # s = PI * R * R24     # PI =......
阅读全文
  • 01月
  • 18日
综合 ⁄ 共 1677字 评论关闭
  导读:对于开发者来说,社区里丰富的开源代码其实是笔极为宝贵的财富。如果能充分利用好开放源代码的资源,不仅可以掌握多种编程方法,提高实践能力,还能获得好的思想,激发编程灵感。开源代码怎么学以及怎样才能学好是大家经常关注的话题,日前,在问答网站知乎上,有人抛出了“如何更有效地学习开源项目的代码?”的话题,众技术好手各抒己见,CSDN软件研发频道对本文内容进行了整理,方便大家学习与参考。 盛大创新研究院研究员 庄表伟:学习开源 尽可能在代码里找答案 庄表伟提供了以下9个建议: 1.在下载源代码之后,首先要......
阅读全文
  • 12月
  • 16日
综合 ⁄ 共 1783字 评论关闭
//数组栈,对于无法预料栈的长度情况下,可能会因为原分配数组不够长而导致数据溢出,或因为数组太长而浪费空间。但是操作快,不需要额外的操作。而链表与此想法,可以动态分配内存,但是要增加额外的操作。 #include <stdio.h> #include <stdlib.h> #include "stack.h" int main() {  int i;  Type x;  STACK *s = NULL;  Type arr[] = {3,1,2,5,7,9};  s = CreateStack(10);  if(s == NULL)   return -1;  for(i = 0; i < sizeof(arr)/sizeof(*arr); i++)  {   PushStack(s, arr + i);  }  TopAndPopStack(s, &am......
阅读全文