上一页 1 2 3 4 5 6 7 ··· 10 下一页

2013年4月29日

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 铁树银花 阅读(398) 评论(0) 推荐(0) 编辑

2013年4月28日

编程经验总结

摘要: 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 铁树银花 阅读(159) 评论(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 铁树银花 阅读(322) 评论(0) 推荐(0) 编辑

2013年4月27日

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 铁树银花 阅读(213) 评论(0) 推荐(0) 编辑

2013年4月21日

8086CPU寄存器

摘要: 阅读全文

posted @ 2013-04-21 11:05 铁树银花 阅读(137) 评论(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 铁树银花 阅读(1256) 评论(0) 推荐(0) 编辑

2013年4月20日

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 铁树银花 阅读(317) 评论(0) 推荐(0) 编辑

2013年4月19日

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 铁树银花 阅读(3374) 评论(0) 推荐(0) 编辑

2013年4月16日

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 铁树银花 阅读(456) 评论(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 铁树银花 阅读(679) 评论(0) 推荐(0) 编辑

2013年4月8日

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 铁树银花 阅读(377) 评论(0) 推荐(0) 编辑

2013年4月3日

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 铁树银花 阅读(590) 评论(0) 推荐(0) 编辑

2013年4月2日

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 铁树银花 阅读(354) 评论(0) 推荐(0) 编辑

2013年3月30日

Codeforces Round #176 (Div. 2) A. IQ Test(简单搜索)

摘要: A. IQ Testtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn the city of Ultima Thule job applicants are often offered an IQ test.The test is as follows: the person gets a piece of squared paper with a4 × 4square painted on it. Some of the s 阅读全文

posted @ 2013-03-30 16:39 铁树银花 阅读(452) 评论(0) 推荐(0) 编辑

Codeforces Round #175 (Div. 2) C. Building Permutation(贪心)

摘要: C. Building Permutationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPermutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct positive integers, each of them doesn't exceed n. We'll denote the i-th element o 阅读全文

posted @ 2013-03-30 13:36 铁树银花 阅读(247) 评论(0) 推荐(0) 编辑

2013年3月29日

Codeforces Round #175 (Div. 2) B. Find Marble(简单模拟)

摘要: B. Find Marbletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya and Vasya are playing a game. Petya's gotnnon-transparent glasses, standing in a row. The glasses' positions are indexed with integers from1tonfrom left to right. Note th 阅读全文

posted @ 2013-03-29 21:37 铁树银花 阅读(371) 评论(0) 推荐(0) 编辑

Qt初始化窗口大小

摘要: 在构造函数中使用this->resize( QSize( x, y ));其中x和y分别是窗口的长和高。 阅读全文

posted @ 2013-03-29 16:31 铁树银花 阅读(762) 评论(0) 推荐(0) 编辑

2013年3月28日

Codeforces Round #175 (Div. 2) A. Slightly Decreasing Permutations(构造,简单)

摘要: A. Slightly Decreasing Permutationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPermutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct positive integers, each of them doesn't exceed n. We'll denote the i- 阅读全文

posted @ 2013-03-28 23:45 铁树银花 阅读(352) 评论(0) 推荐(0) 编辑

2013年3月27日

错误:no matching function for call to 'Ui_***::retranslateUi()'

摘要: 错误出现在“retranslateUi();”一句,改为“retranslateUi(***);”,***就是error中'Ui_***::retranslateUi()'中的相应内容 阅读全文

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

2013年3月26日

Codeforces Round #174 (Div. 2) Cows and Sequence(线段树)

摘要: C. Cows and Sequencetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBessie and the cows are playing with sequences and need your help. They start with a sequence, initially containing just the number 0, and perform n operations. Each operation is 阅读全文

posted @ 2013-03-26 19:35 铁树银花 阅读(320) 评论(0) 推荐(1) 编辑

2013年3月25日

Codeforces Round #174 (Div. 2) B. Cows and Poker Game(简单)

摘要: B. Cows and Poker Gametime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n cows playing poker at a table. For the current betting phase, each player's status is either "ALLIN", "IN", or "FOLDED", and does 阅读全文

posted @ 2013-03-25 17:49 铁树银花 阅读(282) 评论(0) 推荐(0) 编辑

2013年3月23日

Ignatius's puzzle(数学)

摘要: Ignatius's puzzleTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4513Accepted Submission(s): 3068Problem DescriptionIgnatius is poor at math,he falls across a puzzle problem,so he has no choice but to appeal to Eddy. this problem describes that 阅读全文

posted @ 2013-03-23 16:18 铁树银花 阅读(444) 评论(0) 推荐(0) 编辑

2013年3月22日

Ignatius and the Princess II(STL)

摘要: Ignatius and the Princess IITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3163Accepted Submission(s): 1883Problem DescriptionNow our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty P 阅读全文

posted @ 2013-03-22 16:54 铁树银花 阅读(276) 评论(0) 推荐(0) 编辑

STL之next_permutation——求全排列

摘要: next_permutation功能:将[first, last)范围内的排列重组为字典序更大的下一个新排列。permutation正是“排列”之意。调用形式:next_permutation(first, last),其中,first是指向排列头元素的指针,last是指向排列末元素再下一位的指针,两者给出排列范围:[first, last).函数所在头文件:<algorithm>例子: 1 #include <iostream> 2 #include <algorithm> 3 using namespace std; 4 5 int main() 6 { 阅读全文

posted @ 2013-03-22 16:37 铁树银花 阅读(250) 评论(0) 推荐(0) 编辑

Codeforces Round #174 (Div. 2) Cows and Primitive Roots(数论)

摘要: Cows and Primitive Rootstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe cows have just learned what a primitive root is! Given a prime p, a primitive root is an integer x (1 ≤ x < p) such that none of integers x - 1, x2 - 1, ..., xp - 2 -  阅读全文

posted @ 2013-03-22 13:46 铁树银花 阅读(325) 评论(0) 推荐(0) 编辑

2013年3月20日

I Think I Need a Houseboat(计算几何,水题)

摘要: I Think I Need a HouseboatTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 75574Accepted: 32356DescriptionFred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrinking 阅读全文

posted @ 2013-03-20 17:56 铁树银花 阅读(245) 评论(0) 推荐(0) 编辑

Hangover(水题)

摘要: HangoverTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 86843Accepted: 41852DescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to the table 阅读全文

posted @ 2013-03-20 17:44 铁树银花 阅读(237) 评论(0) 推荐(0) 编辑

2013年3月19日

Too few operands to instruction

摘要: 解释:指令中操作数太少出错现场:1 mov Ax 01h2 mov AL 23b错因:少了逗号(囧......)正解:mov AX, 01h 阅读全文

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

2013年3月18日

Balanced Lineup(简单的线段树)

摘要: Balanced LineupTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 26339Accepted: 12351Case Time Limit: 2000MSDescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with som 阅读全文

posted @ 2013-03-18 20:42 铁树银花 阅读(256) 评论(0) 推荐(0) 编辑

D. Colorful Graph(坑爹题)

摘要: D. Colorful Graphtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has 阅读全文

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

Shaking Your Cellphone(并查集)

摘要: Shaking Your Cellphone Time Limit:1000MS Memory Limit:65535KB 64bit IO Format:%lld & %llu Submit Status Practice UESTC 1700Description Do you know a software called "WeiXin", a kind of chatting tool? There is an application called "Shaking for a while". Once you shake your ce 阅读全文

posted @ 2013-03-18 17:24 铁树银花 阅读(255) 评论(0) 推荐(0) 编辑

2013年3月12日

Codeforces Round #171 (Div. 2) B. Books(DP)

摘要: B. Bookstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhen Valera has got some free time, he goes to the library to read some books. Today he's got t free minutes to read. That's why Valera took n books in the library and for each book 阅读全文

posted @ 2013-03-12 16:27 铁树银花 阅读(602) 评论(0) 推荐(0) 编辑

2013年3月10日

error: '>>' should be '> >' within a nested template argument list|

摘要: 错误现场:vector<pair<ll, int>> v;在“<<”中加一个空格即可:vector<pair<ll, int> > v; 阅读全文

posted @ 2013-03-10 17:06 铁树银花 阅读(4577) 评论(0) 推荐(0) 编辑

C++ pair(对组)用法

摘要: 类模板:template <class T1, class T2> struct pair参数:T1是第一个值的数据类型,T2是第二个值的数据类型。功能:pair将一对值组合成一个值,这一对值可以具有不同的数据类型(T1和T2),两个值可以分别用pair的两个公有函数first和second访问。具体用法:1.定义(构造):1 pair<int, double> p1; //使用默认构造函数2 pair<int, double> p2(1, 2.4); //用给定值初始化3 pair<int, double> p3(p2); //拷贝构造函数2. 阅读全文

posted @ 2013-03-10 16:30 铁树银花 阅读(31849) 评论(2) 推荐(5) 编辑

Codeforces Round #171 (Div. 2) A. Point on Spiral(模拟)

摘要: A. Point on Spiraltime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputValera the horse lives on a plane. The Cartesian coordinate system is defined on this plane. Also an infinite spiral is painted on the plane. The spiral consists of segments: [(0,  阅读全文

posted @ 2013-03-10 11:49 铁树银花 阅读(396) 评论(0) 推荐(0) 编辑

2013年3月9日

Codeforces Round #170 (Div. 2) C. Learning Languages(并查集)

摘要: C. Learning Languagestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe "BerCorp" company has got n employees. These employees can use m approved official languages for the formal correspondence. The languages are numbered with integer 阅读全文

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

2013年3月6日

无法定位程序输入点_Z5qFreePv于动态链接库QtCore4.dll

摘要: 在环境变量PATH中,把Qt的bin文件夹的目录的路径放到第一位,以防别的文件里面也有QtCore4.dlL,保证调用的是qt/bin中的dll文件 阅读全文

posted @ 2013-03-06 20:50 铁树银花 阅读(995) 评论(0) 推荐(0) 编辑

运行Qt release版本时出现“丢失QtCore4.dll”错误

摘要: 在Qt安装目录的bin文件夹中寻找QtCore4.dll文件,如果没找到,就到网上下载一个放入其中,否则就是环境变量没有设置好。把该文件所在目录的路径添加到环境变量中即可。 阅读全文

posted @ 2013-03-06 20:47 铁树银花 阅读(554) 评论(0) 推荐(0) 编辑

免费馅饼(二维DP)

摘要: 免费馅饼 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1176Description都 说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉, 就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在 小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中 阅读全文

posted @ 2013-03-06 17:01 铁树银花 阅读(314) 评论(0) 推荐(0) 编辑

2013年3月5日

C++ GUI Qt4 自学笔记——Qt qmake命令

摘要: 在已经使用Designer生成对话框(.ui文件)和建立main.cpp文件的情况下,可以利用qmake自动生成工程文件(.pro文件)和makefile文件,而makefile文件又能调用user interface compiler(uic),uic工具将.ui文件转换成C++代码并存储到相应的ui_***.h文件中,这里的“***”就是此前建立的对话框的名字。本文以《C++ GUI Qt4 编程(第二版)》中第二章第三节《快速设计对话框》中的内容为例进行说明。即使没有阅读过该书,同样可以阅读并理解以下内容。一、设计对话框并建立main.cpp首先用Qt Designer设计一个对话框,假 阅读全文

posted @ 2013-03-05 20:27 铁树银花 阅读(5711) 评论(0) 推荐(1) 编辑

上一页 1 2 3 4 5 6 7 ··· 10 下一页

导航