04 2013 档案

Qt如何获取控件的坐标
摘要:以pushButton为例,假设一个按钮控件的名称为mybutton,通过mybutton->x()和mybutton->y()可以分别获得横坐标和纵坐标 阅读全文

posted @ 2013-04-30 20:22 铁树银花 阅读(7236) 评论(0) 推荐(1)

Qt 写文件失败
摘要:今天在学习使用Qt写文件时,发现写文件后打开该文件居然什么都没有。后来发觉原因是文件路径出错,在之前使用VS时文件路径若不指明,默认是应用程序所在目录,在Qt中就出错了。使用QFilefile("data.txt");则在应用程序所在目录下的data文件未能显示写入的信息,实际上语句操作的对象也不是该文件。使用QFilefile("F:\\data.txt");则信息成功写入F盘下的data文件关于Qt的文件路径设置仍在学习中~2013-04-30 14:24:50 阅读全文

posted @ 2013-04-30 14:24 铁树银花 阅读(482) 评论(0) 推荐(0)

Qt undefined reference to `vtable for paint'
摘要:构建Qt项目时出现error:“undefined reference to `vtable for XXX'”。其中XXX是工程的一个头文件的名字。出现这个问题的原因可能是我修改了工程的内容而Qt没有检测到,我的解决方案是重现执行qmake(菜单栏“构建” -> “执行qmake”),再次构建项目,能正常启动和退出。 阅读全文

posted @ 2013-04-30 11:36 铁树银花 阅读(206) 评论(0) 推荐(0)

Codeforces Round #179 (Div. 2) B. Yaroslav and Two Strings(组合数学)
摘要:B. Yaroslav and Two Stringstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYaroslav thinks that two stringssandw, consisting of digits and having lengthnare non-comparable if there are two numbers,iandj(1 ≤ i, j ≤ n), such thatsi > wiandsj < 阅读全文

posted @ 2013-04-29 17:55 铁树银花 阅读(411) 评论(0) 推荐(0)

编程经验总结
摘要:1.在使用BFS时要用到队列保存结点,同时一般要设置一个布尔型数组vis标记已经访问过的结点,初始值为0,访问过设为1.那么设置vis[i]=1的时机是什么时候呢?这仿佛是个白痴的问题,但如果不注意却有可能使得广搜过程中重复地搜索已访问的的结点而使得时耗大增。答案是在que.push(i);后立即执行vis[i] = true;这样才能有效地标记每一个进入队列的结点。我曾经试过在pop后才标记vis[i]=1,这样就造成了标记滞后,在pop之前可能结点i就被重复访问了。2.(a+b)%c = (a%c+b%c)%c正确,但是(a-b)%c = (a%c-b%c)%c不一定,比如a=7,b=5, 阅读全文

posted @ 2013-04-28 14:00 铁树银花 阅读(174) 评论(0) 推荐(0)

最大流EK算法模板(BFS实现)
摘要:变量解释:s-源点d-汇点r[i][j]-残留网络中结点i和结点j间的流量,初始值为边<i,j>的容量flow[i]-记录从源点到结点i的路径<s,...,i>可容纳的最大流量,显然由最短板原理,flow[i]为路径<s,...,i>中容量最少的那一段的容量pre[i]-记录结点i的前驱结点,以便保存增广路径,同时标记已加入队列的结点,避免重复访问 1 #define min(x, y) ((x) < (y) ? (x) : (y)) 2 3 const int maxn = 405; 4 const int inf = 0x7fffffff; 5 i 阅读全文

posted @ 2013-04-28 13:50 铁树银花 阅读(337) 评论(0) 推荐(0)

The Perfect Stall(二分图匹配,最大流EK算法)
摘要:The Perfect StallTime Limit:1000MSMemory Limit:10000KTotal Submissions:15553Accepted:7118DescriptionFarmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering problems, all the stalls in the new barn are different. For the fi 阅读全文

posted @ 2013-04-27 23:48 铁树银花 阅读(224) 评论(0) 推荐(0)

8086CPU寄存器
摘要: 阅读全文

posted @ 2013-04-21 11:05 铁树银花 阅读(145) 评论(0) 推荐(0)

逻辑地址和物理地址
摘要:什么是逻辑地址?什么是物理地址?如何将逻辑地址转换为物理地址?解:逻辑地址是指在程序和指令中使用的一种地址,它包括两部分:段基地址和偏移地址。段基地址说明每段在主存中的起始位置,它来自于段寄存器(CS、DS、ES、SS)。偏移地址说明主存单元距离段起始位置的偏移量。它是一个16位的偏移地址,根据指令的不同,它可以来自于8086CPU中不同的16位寄存器 IP、SP、BP、SI、DI、BX等。物理地址是指CPU对存储器进行访问时实际寻址所使用的地址,物理地址是由段寄存器与偏移地址共同确定的。在实际工作时,从段寄存器中取出段基址,将其左移4位,再与16位偏移地址相加,就得到了物理地址,此地址在CP 阅读全文

posted @ 2013-04-21 11:01 铁树银花 阅读(1330) 评论(0) 推荐(0)

Drainage Ditches(最大流入门)
摘要:Drainage DitchesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5649Accepted Submission(s): 2666Problem DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is 阅读全文

posted @ 2013-04-20 23:04 铁树银花 阅读(331) 评论(0) 推荐(0)

matlab7“This application has requested the Runtime to terminate it in an unusual way Please contact the applicatin's support team for more...”
摘要:安装好matlab7后一运行就弹出错误对话框,显示内容大致如下:Microsoft visual C++ Runtime Library : RunTime Error! Program:E:\MATLAB701\bin\win32\MATLAB.exe This application has requested the Runtime to terminate it in an unusual way Please contact the applicatin's support team for more information解决方案:在安装目录的bin文件夹中找到matlab 阅读全文

posted @ 2013-04-19 16:01 铁树银花 阅读(3501) 评论(0) 推荐(0)

Look Up
摘要:Problem 1845 Look UpAccept: 173Submit: 543Time Limit: 1000 mSecMemory Limit : 32768 KBProblem DescriptionN (1 <= N <= 100,000) monkeys in the mountains, conveniently numbered 1..N, are once again standing in a row. Monkey i has height Hi(1 <= Hi<= 1,000,000).Each monkey is looking to his 阅读全文

posted @ 2013-04-16 17:58 铁树银花 阅读(480) 评论(0) 推荐(0)

Codeforces Round #179 (Div. 2) A. Yaroslav and Permutations(简单)
摘要:A. Yaroslav and Permutationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYaroslav has an array that consists of n integers. In one second Yaroslav can swap two neighboring array elements. Now Yaroslav is wondering if he can obtain an array whe 阅读全文

posted @ 2013-04-16 09:46 铁树银花 阅读(690) 评论(0) 推荐(0)

Substring Frequency (KMP)
摘要:Substring FrequencyTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit Status Practice LightOJ 1255DescriptionA string is a finite sequence of symbols that are chosen from an alphabet. In this problem you are given two non-empty strings A and B, both contain lower case Engli 阅读全文

posted @ 2013-04-08 13:17 铁树银花 阅读(390) 评论(0) 推荐(0)

Harmonic Number(打表法)
摘要:Harmonic Number Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit Status Practice LightOJ 1234DescriptionIn mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers:In this problem, you are given n, you have to find Hn.InputInput st 阅读全文

posted @ 2013-04-03 20:08 铁树银花 阅读(611) 评论(0) 推荐(0)

False Ordering(统计因子个数、素因子分解)
摘要:False OrderingTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%lld & %lluSubmitStatusPracticeLightOJ 1109DescriptionWe definebis a Divisor of a numberaifais divisible byb. So, the divisors of 12 are 1, 2, 3, 4, 6, 12. So, 12 has 6 divisors.Now you have to order all the integers from 1 to 10 阅读全文

posted @ 2013-04-02 21:46 铁树银花 阅读(366) 评论(0) 推荐(0)

导航