[置顶] 杭电ACM题目分类

摘要: 1001 入门1002 简单的大数1003 DP经典问题,最大连续子段和1004 简单题1005 找规律(循环点)1006 感觉有点BT的题,我到现在还没过1007 经典问题,最近点对问题,用分治1008 简单题1009 贪心1010 搜索题,剪枝很关键10111012 简单题1013 简单题(有个小陷阱)1014 简单题1015 可以看作搜索题吧1016 经典的搜索1017 简单数学题1018 简单数学题1019 简单数学题1020 简单的字符串处理1021 找规律的数学题1022 数据结构的题(栈的应用)1023 特殊的数(Catalan Number)1024 经典DP,最大M子段和10 阅读全文

posted @ 2012-04-05 22:23 铁树银花 阅读(308) 评论(0) 推荐(0) 编辑

2013年10月21日

undefined reference to `_imp___ZN8QWebViewC1EP7QWidget'

摘要: add this line to your .pro file:QT += webkitwidgets 阅读全文

posted @ 2013-10-21 13:27 铁树银花 阅读(2242) 评论(0) 推荐(0) 编辑

2013年10月18日

ps裁剪圆角

摘要: 1.打开要编辑的图片 2.选择圆角矩形工具,并调整半径(半径越大,角越圆),本例半径为20像素3.使用上述工具画出选区4.按下ctrl+enter,可以看到选区边缘描上了虚线5.菜单栏-图像-剪裁6.按下delete,删除黑色的那个图层。7.复制(crtl + c)8.新建图像后粘贴(ctrl + v),可以看到圆角图片出来了!8.设置背景不可见,在保存为png文件,这样保存得的图片才不会出现四角处白色的背景9.完成o(∩_∩)o 阅读全文

posted @ 2013-10-18 20:59 铁树银花 阅读(2378) 评论(0) 推荐(0) 编辑

ps图像渐变

摘要: 整理自:http://zhidao.baidu.com/question/16374167.html1.用ps打开图片2.在切换至英文输入法状态下(下面的操作均如此)按q 快捷键q的作用是切换标准模式和快速蒙板模式,默认是标准模板模式,按一次q进入快速蒙板模式)3.按下d 快捷键d的作用是采用默认前景色和背景色)4.按下g 该快捷键用于选择渐变工具、油漆桶工具,注意这两个工具是位于同一位置的,如果当前并非选择渐变工具要先行调整: 5.在打开的图像上拉出一个渐变6.按下q 该步退回标准模板模式7.按下delete8.文件-存储为 。。。 阅读全文

posted @ 2013-10-18 19:16 铁树银花 阅读(373) 评论(0) 推荐(0) 编辑

2013年10月7日

QPaintDevice: Cannot destroy paint device that is being painted

摘要: 在paintEvent中,使用QPainter * 绘制图像出现此问题。解决:1、改为不使用QPainter指针。2、添上begin(), end()QPainter * painter = new QPainter();painter->begin (this);//!!!painter->drawLine (...);painter->end ();//!!! 阅读全文

posted @ 2013-10-07 10:30 铁树银花 阅读(4539) 评论(1) 推荐(1) 编辑

QWidget::paintEngine: Should no longer be called

摘要: Qt新手,其实并不知道出现这个问题的本质原因,我的问题在于paintEvent中使用的painter是类的成员而不是临时新建的局部变量,改为使用局部变量问题就消失了。 阅读全文

posted @ 2013-10-07 10:14 铁树银花 阅读(5819) 评论(0) 推荐(0) 编辑

权谋 — 朱元璋

摘要: 1.太祖谓徐达曰:“渡江幸捷,若舍而归,江东非吾有也。”乃悉断舟缆,放急流中,谓诸将曰:“太平甚近,当与公等取之。”2.三月癸未,进攻集庆,擒兆先,降其众三万六千人,皆疑惧不自保。太祖择骁健者五百人入卫,解甲酣寝达旦,众心始安。3.石抹宜孙遣将率车师由松溪来援,太祖曰:“道狭,车战适取败耳。”4.戒诸将曰:“克城以武,戡乱(平定叛乱)以仁。吾比入集庆,秋毫无犯,故一举而定。每闻诸将得一城不妄杀,辄喜不自胜。夫师行如火,不戢将燎原。为将能以不杀为武,岂惟国家之利,子孙实受其福。”5.诸将议先复太平以牵之,太祖曰:“不可。彼居上游,舟师十倍于我,猝难复也。”或请自将迎击,太祖曰:“不可。彼以偏师缀 阅读全文

posted @ 2013-10-07 00:12 铁树银花 阅读(717) 评论(0) 推荐(0) 编辑

2013年10月2日

TL(简单)

摘要: TLtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputValera wanted to prepare a Codesecrof round. He's already got one problem and he wants to set a time limit (TL) on it.Valera has writtenncorrect solutions. For each correct solution, he knows 阅读全文

posted @ 2013-10-02 18:28 铁树银花 阅读(949) 评论(0) 推荐(0) 编辑

2013年9月29日

Access“输入的表达式中含有一个无效日期值”

摘要: 环境:access2003 + win7有图有真相:明显地看到,日期那里显示了“星期X”,问题的根源就在这里。。。更改计算机的日期显示设置为不显示星期~方法:点击右下角的时钟-点击“更改日期和时间设置”-点击“更改日期和时间”-点击“更改日历设置”-设置日期格式(我想最好根据数据库表中的日期格式更改吧)~然后就可以正常使用access啦~2013-09-2920:04:41 阅读全文

posted @ 2013-09-29 20:03 铁树银花 阅读(9232) 评论(0) 推荐(0) 编辑

2013年9月28日

Qt label加边框

摘要: myLabel->setStyleSheet("border:1px solid black");简要说明:border就是边缘。px是像素,1px就是边框的宽度。solid是实线,边框设置为实线。black设置边框为黑色,还可以用green、red等。用rgb(para1 , para2, para3)也可控制颜色。2013-09-28 17:02:30 阅读全文

posted @ 2013-09-28 17:03 铁树银花 阅读(3089) 评论(0) 推荐(0) 编辑

2013年9月20日

Guardian of Decency(二分图)

摘要: Guardian of DecencyTime Limit:3000MSMemory Limit:0KB64bit IO Format:%lld & %lluSubmitStatusPracticeUVALive 3415DescriptionProblem H - Guardian of DecencyTime limit: 15 secondsFrank N. Stein is a very conservative high-school teacher. He wants to take some of his students on an excursion, but he 阅读全文

posted @ 2013-09-20 13:10 铁树银花 阅读(550) 评论(0) 推荐(0) 编辑

匈牙利算法的小总结

摘要: 背景:设G=(V,E)是一个无向图。如顶点集V可分区为两个互不相交的子集V1,V2之并,并且图中每条边依附的两个顶点都分属于这两个不同的子集。则称图G为二分图。二分图也可记为G=(V1,V2,E)。给定一个二分图G,在G的一个子图M中,M的边集{E}中的任意两条边都不依附于同一个顶点,则称M是一个匹配。 选择这样的子集中边数最大的子集称为图的最大匹配问题(maximal matching problem)(引自维基百科)1. 匹配边:连结分属于V1和V2的两个顶点的边。其他边是未匹配边。2.匹配点:匹配边所连结的顶点。不在匹配边上的顶点就是未匹配点。3.交错路:设P是图G的一条路,如果P的任意 阅读全文

posted @ 2013-09-20 13:08 铁树银花 阅读(425) 评论(0) 推荐(0) 编辑

2013年9月19日

Simple Molecules(简单)

摘要: Simple Moleculestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMad scientist Mike is busy carrying out experiments in chemistry. Today he will attempt to join three atoms into one molecule.A molecule consists of atoms, with some pairs of atoms co 阅读全文

posted @ 2013-09-19 14:09 铁树银花 阅读(557) 评论(0) 推荐(0) 编辑

2013年9月13日

Heavy Transportation(最短路 + dp)

摘要: Heavy TransportationTime Limit:3000MSMemory Limit:30000KB64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 1797DescriptionBackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a 阅读全文

posted @ 2013-09-13 00:46 铁树银花 阅读(878) 评论(0) 推荐(0) 编辑

2013年9月11日

让C程序更高效的10种方法(转)

摘要: 原文:http://blog.jobbole.com/1198/代码之美,不仅在于为一个给定问题找到解决方案,而且还在代码的简单性、有效性、紧凑性和效率(内存)。代码设计比实际执行更难 。因此,每一个程序员当用C语言编程时,都应该记着这些东西。本文向你介绍规范你的C代码的10种方法。0. 避免不必要的函数调用考虑下面的2个函数:void str_print( char *str ){ int i; for ( i = 0; i < strlen ( str ); i++ ) { printf("%c",str[ i ] ); }}void str_print1 ( c 阅读全文

posted @ 2013-09-11 19:25 铁树银花 阅读(326) 评论(0) 推荐(0) 编辑

2013年9月9日

Silver Cow Party(最短路,好题)

摘要: Silver Cow PartyTime Limit:2000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 3268DescriptionOne cow from each ofNfarms (1 ≤N≤ 1000) conveniently numbered 1..Nis going to attend the big cow party to be held at farm #X(1 ≤X≤N). A total ofM(1 ≤M≤ 100,000) unidirectional 阅读全文

posted @ 2013-09-09 22:08 铁树银花 阅读(3118) 评论(0) 推荐(0) 编辑

2013年9月8日

Xenia and Divisors

摘要: Xenia and Divisorstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputXenia the mathematician has a sequence consisting ofn(nis divisible by 3) positive integers, each of them is at most 7. She wants to split the sequence into groups of three so that 阅读全文

posted @ 2013-09-08 00:15 铁树银花 阅读(488) 评论(0) 推荐(0) 编辑

2013年9月6日

Frogger(floyd变形)

摘要: FroggerTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 2253DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full 阅读全文

posted @ 2013-09-06 09:35 铁树银花 阅读(334) 评论(0) 推荐(0) 编辑

2013年9月3日

Til the Cows Come Home(最短路)

摘要: Til the Cows Come HomeTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 2387DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beau 阅读全文

posted @ 2013-09-03 19:45 铁树银花 阅读(2531) 评论(0) 推荐(0) 编辑

编程中无穷大常量的设定技巧(转)

摘要: 转自http://aikilis.tk/如果问题中各数据的范围明确,那么无穷大的设定不是问题,在不明确的情况下,很多程序员都取0x7fffffff作为无穷大,因为这是32-bit int的最大值。如果这个无穷大只用于一般的比较(比如求最小值时min变量的初值),那么0x7fffffff确实是一个完美的选择,但是在更多的情况下,0x7fffffff并不是一个好的选择。很多时候我们并不只是单纯拿无穷大来作比较,而是会运算后再做比较,例如在大部分最短路径算法中都会使用的松弛操作:if (d[u]+w[u][v]<d[v]) d[v]=d[u]+w[u][v];我们知道如果u,v之间没有边,那么 阅读全文

posted @ 2013-09-03 09:40 铁树银花 阅读(579) 评论(0) 推荐(0) 编辑

2013年9月2日

Qt Style Sheets Examples——定制前景色和背景色

摘要: 例子取自:http://qt-project.org/doc/qt-4.8/stylesheet-examples.html以lineEdit为例(1)设置某个lineEdit的背景色为黄色lineEdit->setStyleSheet ("background-color:yellow");(2)设置一个应用项目中所有lineEdit的背景色均为黄色(line 4)1 int main(int argc, char *argv[])2 {3 QApplication a(argc, argv);4 a.setStyleSheet ("QLineEdit { 阅读全文

posted @ 2013-09-02 17:24 铁树银花 阅读(4052) 评论(0) 推荐(0) 编辑

2013年8月29日

Xenia and Bit Operations(线段树单点更新)

摘要: Xenia and Bit Operationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputXenia the beginner programmer has a sequencea, consisting of2nnon-negative integers:a1, a2, ..., a2n. Xenia is currently studying bit operations. To better understand how the 阅读全文

posted @ 2013-08-29 01:13 铁树银花 阅读(404) 评论(0) 推荐(0) 编辑

2013年8月28日

Xenia and Weights(深度优先搜索)

摘要: Xenia and Weightstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputXenia has a set of weights and pan scales. Each weight has an integer weight from 1 to 10 kilos. Xenia is going to play with scales and weights a little. For this, she puts weights 阅读全文

posted @ 2013-08-28 15:04 铁树银花 阅读(454) 评论(0) 推荐(0) 编辑

Fire!(BFS)

摘要: Fire!Time Limit:1000MSMemory Limit:0KB64bit IO Format:%lld & %lluSubmitStatusDescriptionProblem B: Fire!Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help Joe escape the maze.Given Joe's locatio 阅读全文

posted @ 2013-08-28 12:22 铁树银花 阅读(543) 评论(0) 推荐(0) 编辑

2013年8月26日

Quiz(贪心,快速幂乘)

摘要: C. Quiztime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputManao is taking part in a quiz. The quiz consists ofnconsecutive questions. A correct answer gives one point to the player. The game also has a counter of consecutive correct answers. When the 阅读全文

posted @ 2013-08-26 21:00 铁树银花 阅读(530) 评论(0) 推荐(0) 编辑

Qt的零碎知识

摘要: 1.QObject是所有Qt对象的基类,他给C++的类带来了若干新的功能。使用Q_OBJECT宏能声明一个C++类为一个QObject。如: 1 class Notepad : public QMainWindow 2 { 3 Q_OBJECT 4 5 public: 6 explicit Notepad(QWidget *parent = 0); 7 ~Notepad(); 8 9 private:10 Ui::Notepad *ui;11 };View Code3.类A有界面类成员widget,widget放入QStackedWidget中,若已经通过s... 阅读全文

posted @ 2013-08-26 00:05 铁树银花 阅读(750) 评论(0) 推荐(0) 编辑

2013年8月24日

Routine Problem(数学)

摘要: Routine Problemtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputManao has a monitor. The screen of the monitor has horizontal to vertical length ratioa:b. Now he is going to watch a movie. The movie's frame has horizontal to vertical length rat 阅读全文

posted @ 2013-08-24 23:59 铁树银花 阅读(477) 评论(0) 推荐(0) 编辑

2013年8月23日

2^x mod n = 1(欧拉定理,欧拉函数,快速幂乘)

摘要: 2^x mod n = 1Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9231Accepted Submission(s): 2837Problem DescriptionGive a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1.InputOne positive integer on each line, the value of n.OutputIf 阅读全文

posted @ 2013-08-23 11:22 铁树银花 阅读(3542) 评论(0) 推荐(1) 编辑

2013年8月9日

Malek Dance Club(递推)

摘要: Malek Dance Clubtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs a tradition, every year before IOI all the members of Natalia Fan Club are invited to Malek Dance Club to have a fun night together. Malek Dance Club has2nmembers and coincidentall 阅读全文

posted @ 2013-08-09 19:30 铁树银花 阅读(537) 评论(0) 推荐(0) 编辑

2013年8月8日

Color Me Less

摘要: Color Me LessTime Limit:2 Seconds Memory Limit:65536 KBProblemA color reduction is a mapping from a set of discrete colors to a smaller one. The solution to this problem requires that you perform just such a mapping in a standard twenty-four bit RGB color space. The input consists of a target set of 阅读全文

posted @ 2013-08-08 21:19 铁树银花 阅读(661) 评论(0) 推荐(0) 编辑

Traffic Lights

摘要: Traffic Lightstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA car moves from point A to point B at speedvmeters per second. The action takes place on the X-axis. At the distancedmeters from A there are traffic lights. Starting from time 0, for 阅读全文

posted @ 2013-08-08 20:31 铁树银花 阅读(614) 评论(0) 推荐(0) 编辑

2013年8月7日

Ping-Pong (Easy Version)(DFS)

摘要: B. Ping-Pong (Easy Version)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn this problem at each moment you have a set of intervals. You can move from interval(a, b)from our set to interval(c, d)from our set if and only ifc 2 #include 3 #incl.. 阅读全文

posted @ 2013-08-07 20:15 铁树银花 阅读(483) 评论(0) 推荐(0) 编辑

Ciel and Robot

摘要: C. Ciel and Robottime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel has a robot on a 2D plane. Initially it is located in (0, 0). Fox Ciel code a command to it. The command was represented by strings. Each character ofsis one move operation. 阅读全文

posted @ 2013-08-07 01:12 铁树银花 阅读(674) 评论(0) 推荐(0) 编辑

2013年8月4日

Qt Error: dependent '..\***' does not exist.

摘要: 大概意思:所依赖的资源不存在。实际上是工程找不到所依赖的资源。本人的解决方案(可能拙劣,也不一定是正道):将资源拷贝到工程目录下。 阅读全文

posted @ 2013-08-04 16:04 铁树银花 阅读(6703) 评论(0) 推荐(0) 编辑

2013年8月3日

Qt 判断文件是否存在

摘要: 包含头文件:代码:QFileInfo file("文件路径");if(file.exists()==false){文件不存在;} 阅读全文

posted @ 2013-08-03 16:36 铁树银花 阅读(18265) 评论(0) 推荐(0) 编辑

Qt 添加资源文件

摘要: *本人乃小白,博文主要用于个人记录,不保证内容准确无误*我们编写的gui可能需要一些额外的资源(比如贴图用的图片),可用资源文件统一管理。以下以图片为例。用qt creator 打开工程,为工程新建资源文件:命名为“项目名.prc”,(此处为“clock.qrc”,名字可另起,后缀名不可改)。系统自动切换到资源编辑界面:如果没有自动切换到上述界面,双击clock.qrc即可。选择添加 — 添加前缀,前缀名默认为“/new/prefix1”,改为在前缀一栏输入前缀名“/image”(可以另起,但是“/“”不能变)。选中“/image”(如果只建立了image一个资源文件则自动选中),选择添加 — 阅读全文

posted @ 2013-08-03 16:11 铁树银花 阅读(38949) 评论(0) 推荐(0) 编辑

Qt lcdNumber 不能显示完整时间

摘要: 利用lcdNumber编了一个电子时钟,发现只显示“分”和“秒”,“时”没有显示出来。作为小白一名,谷歌了一下别人的程序才知道,原因是没有设置lcdNumber可以显示的位数,默认应该是显示4位的,所以只显示了分和秒。添加语句:lcdNumber->setDigitCount(8); 阅读全文

posted @ 2013-08-03 14:45 铁树银花 阅读(2397) 评论(0) 推荐(0) 编辑

2013年8月2日

Qt snippet — 打开文件&保存文件

摘要: 打开文件: 1 void Notepad::on_actionOpen_triggered() 2 { 3 QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), QString(), 4 tr("Text Files (*.txt);;C++ Files (*.cpp *.h)")); 5 6 if (!fileName.isEmpty()) { 7 QFile file(fileName); 8 if (!f... 阅读全文

posted @ 2013-08-02 21:16 铁树银花 阅读(1536) 评论(0) 推荐(0) 编辑

2013年8月1日

right-click an action, missing "Go to slot"

摘要: According to the tutorial,to connect the actions to slots, right-click an action and select Go to slot > triggered(). But today when i did this i found there was no “go to slot” . Finally I find i have done sth stupid.I thought that where i should right-click is here:But ... the right position is 阅读全文

posted @ 2013-08-01 23:56 铁树银花 阅读(315) 评论(0) 推荐(0) 编辑

2013年7月31日

Code the Tree(图论,树)

摘要: ZOJ Problem Set - 1097Code the TreeTime Limit:2 Seconds Memory Limit:65536 KBA tree (i.e. a connected graph without cycles) with vertices numbered by the integers1, 2, ..., nis given. The "Prufer" code of such a tree is built as follows: the leaf (a vertex that is incident to only one edge 阅读全文

posted @ 2013-07-31 23:09 铁树银花 阅读(687) 评论(0) 推荐(0) 编辑

2013年7月30日

李代桃僵

摘要: 必有损,损阴以益阳。阴:此指某些细微的、局部的事物。阳:此指事物带整体意义的、全局性的事物。李代桃僵语出《乐府诗集·鸡鸣篇》:“桃生露井上,李树生桃旁,虫来啮[niè]桃根,李树代桃僵,树木身相代,兄弟还相忘?”本意是指兄弟要象桃李共患难一样相互帮助,相互友爱。此计用在军事上,指在敌我双方势均力敌,或者敌优我劣的情况下,用小的代价,换取大的胜利的谋略。 阅读全文

posted @ 2013-07-30 15:09 铁树银花 阅读(204) 评论(0) 推荐(0) 编辑

导航