自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(77)
  • 收藏
  • 关注

原创 Intel 80x86 的程序内存模型解析:从一道面试题说起

开始这篇文章之前,先问一个IT公司在面试的时候可能会问到的问题,以下程序#include using namespace std;int main(){ int a, b, c; cout << &a << endl << &b << endl << &c <<endl; return 0;}编译之后,多次运行,输出的结果是否是一样的?重新编译一次再运行

2012-11-15 18:32:55 614

原创 POJ4000: National Treasures

National TreasuresTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 118 Accepted: 39DescriptionT

2011-09-06 14:11:23 326

原创 POJ4000:National Treasures

题目描述DescriptionThe great hall of the national museum has been robbed few times recently. Everyone is now worried about the security of t

2011-09-06 13:38:49 181

原创 2474 - Balloons in a Box

2474 - Balloons in a Box<br />World Finals - Hawaii - 2001/2002PDF Submit Ranking<br /> <br />You must write a program that simulates placing spherical balloons into a rectangular box. <br />The simulation scenario is as follows. Imagine that you are given

2011-04-13 01:08:00 469

原创 双硬盘WINOWS7+UBUNTU+PCBSD配置成功

沉寂了好几天,刻盘,看handbook,查资料,总算把我想玩的几个系统配置了出来:日立500G硬盘分了四个区安装WINOWS7+UBUNTU,两个主分区NTFS-33G,EXT4-29G+SWAP-4G(算作一个吧),剩下两盘都是NTFS-100+G的,毕竟多数工作还是要用WINDOWS来做的所以就用它的文件系统啦,一个用来装软件一个用来放资料,启动管理器被改成GRUB(迟点我会想办法把它改成WIN7的bootmgr的!)希捷160G硬盘有点老了,有一些没法修复的坏扇区,不过暂时还没有因此而丢资料的经历,所

2011-03-24 01:39:00 596

原创 Assembly Language!!!

GT这学期有汇编语言的课程,第一次接触这么神秘的东东感到很兴奋。所谓“工欲善其事,必先利其器”,最近试了几个汇编的编译环境用着都感觉不太顺手,在无奈和郁闷之中,突然灵光一闪——因为经常写ACM这种小巧程序的关系,我用notepad++加上NppExec插件(用来集成控制台),再加上WinGW作为DOS编译器为源码提供编译生成功能,小巧灵便,写起一两百行左右代码的程序真是无往而不利——那么汇编语言不也可以这样么?于是开始了尝试,下载好MASM,第一步是配置环境变量(环境变量是可以不配置的,但是会给你的编译带来

2011-03-20 01:22:00 397

原创 USACO: Fencing the Cows

Fencing the Cows<br />Hal Burch<br />Farmer John wishes to build a fence to contain his cows, but he's a bit short on cash right. Any fence he builds must contain all of the favorite grazing spots for his cows. Given the location of these spots, determine

2011-03-17 14:16:00 257

原创 USACO进程暂缓

<br />自从chapter4一路刷来,感觉写这些题越来越力不从心,看题解的频率也越来越高,但是这些题都是很经典的,很想自己一道一道琢磨出来,so,现在A完了chapter4最后还算比较简单的几道,决定不赶进度了,先和荣哥刷着黑书上的题(或者写写这学期算法分析课本上的也行),剩下chapter5和chapter6相信是大挑战,什么时候有灵感了就写一道,哈!MARK HERE!

2011-03-15 21:59:00 217

原创 USACO: Pollutant Control

Pollutant Control<br />Hal Burch<br />It's your first day in Quality Control at Merry Milk Makers, and already there's been a catastrophe: a shipment of bad milk has been sent out. Unfortunately, you didn't discover this until the milk was already into you

2011-03-15 21:45:00 337

原创 Windows系列的系统引导

GT前段时间在WinXP的基础上安装了Win7,因为有双硬盘所以直接双系统各占一个硬盘的主分区。我个人经常乱用电脑做各种试验,所以把双系统装到双硬盘上也是未雨绸缪,两个硬盘各施其责互不影响。不过因为安装Win7时是在WinXP下选择“保留较老版本OS的安装”,所以安好Win7之后发现WinXP被“劫持了”:具体表现就是WinXP被整合到了Win7的启动管理器里面,而一旦我把WinXP所在的硬盘设置为主硬盘,启动引导就会报错,无法脱离Win7的启管理器来独立启动WinXP。我的初衷就是想让两个硬盘可以独立工作

2011-03-15 20:45:00 371

原创 USACO: Street Race

Street Race<br />IOI'95<br />Figure 1 gives an example of a course for a street race. You see some points, labeled from 0 to N (here, N=9), and some arrows connecting them. Point 0 is the start of the race; point N is the finish. The arrows represent one-w

2011-03-14 09:07:00 275

原创 USACO: The Primes

The Primes<br />IOI'94<br />In the square below, each row, each column and the two diagonals can be read as a five digit prime number. The rows are read from left to right. The columns are read from top to bottom. Both diagonals are read from left to right

2011-03-12 21:46:00 304

原创 USACO: Buy Low, Buy Lower

Buy Low, Buy LowerThe advice to "buy low" is half the formula to success in the stock market. But to be considered a great investor you must also follow this problems' advice: "Buy low, buy lower"That is, each time you buy a stock, you must purchase more a

2011-03-10 16:09:00 322

原创 USACO: Job Processing

Job ProcessingIOI'96A factory is running a production line that requires two operations to be performed on each job: first operation "A" then operation "B". Only a certain number of machines are capable of performing each operation.  Figure 1 shows the o

2011-03-10 12:33:00 349

原创 USACO: The Perfect Stall

The Perfect Stall<br />Hal Burch<br />Farmer 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 first week, Farmer J

2011-03-09 02:25:00 252

原创 USACO: Drainage Ditches

Drainage Ditches<br />Hal Burch<br />Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow. Thus, Farmer John has built

2011-03-09 01:58:00 232

原创 数据结构大作业

补写一下这个,数据结构的大作业,和荣哥主写代码,从上个学期就合计好很多细节,不过还是懒散了一个寒假,汗呐。所以一回来赶紧就做补救工作。基本要求:有好几个题目,我们选了个比较感兴趣的Tomb Raider(可以译为“古墓丽影”吧?囧zt我们还没时间去实现“丽影”呢)最后presentation的时候也发现多数同学选的是这个和另一个做生态系统Ecosphere (Closed Ecosystem)的,比较有挑战性嘛基本要求是:地图,是个迷宫地图,有可以减速的陷阱;主角,有武器,弹药,食物(补充生命值用的);怪物

2011-03-03 14:51:00 1393

原创 USACO: Cryptcowgraphy

Cryptcowgraphy<br />Brian Dean<br />The cows of Farmer Brown and Farmer John are planning a coordinated escape from their respective farms and have devised a method of encryption to protect their written communications. <br />Specifically, if one cow has a

2011-03-03 12:10:00 374

原创 USACO: Fence Loops

Fence Loops<br /><br />The fences that surround Farmer Brown's collection of pastures have gotten out of control. They are made up of straight segments from 1 through 200 feet long that join together only at their endpoints though sometimes more than two f

2011-02-25 00:46:00 246

原创 USACO: Fence Rails

Fence Rails<br />Burch, Kolstad, and Schrijvers<br />Farmer John is trying to erect a fence around part of his field. He has decided on the shape of the fence and has even already installed the posts, but he's having a problem with the rails. The local lum

2011-02-24 19:08:00 375

原创 USACO: Beef McNuggets

Beef McNuggetsHubert ChenFarmer Brown's cows are up in arms, having heard that McDonalds is considering the introduction of a new product: Beef McNuggets. The cows are trying to find any possible way to put such a product in a negative light. One strategy

2011-01-19 20:07:00 267

原创 USACO: Raucous Rockers

Raucous RockersYou just inherited the rights to N (1 Since you are a classical music fan and have no way to judge the artistic merits of these songs, you decide on the following crit

2011-01-15 02:37:00 388

原创 USACO: American Heritage

American HeritageFarmer John takes the heritage of his cows very seriously. He is not, however, a truly fine bookkeeper. He keeps his cow genealogies as binary trees and, instead of writing them in graphic form, he records them in the more linear `tree in-

2011-01-13 15:41:00 225

原创 USACO: Closed Fences

Closed FencesA closed fence in the plane is a set of non-crossing, connected line segments with N corners (3 Every pair of adjacent vertices defines a side of the fence. Thus {xi yi xi+1 yi+1} is a side of the fence for all i in (1..N). For our purposes, N

2011-01-13 11:26:00 471

原创 USACO: Home on the Range

Home on the RangeFarmer John grazes his cows on a large, square field N (2 Your task is to count up all the various square

2011-01-06 22:21:00 228

原创 USACO: A Game

A Game<br />IOI'96 - Day 1<br />Consider the following two-player game played with a sequence of N positive integers (2 <= N <= 100) laid onto a game board. Player 1 starts the game. The players move alternately by selecting a number from either the left o

2011-01-05 03:10:00 253

原创 USACO: Camelot

<br />Camelot<br />IOI 98<br />Centuries ago, King Arthur and the Knights of the Round Table used to meet every year on New Year's Day to celebrate their fellowship. In remembrance of these events, we consider a board game for one player, on which one ches

2011-01-05 01:51:00 289

原创 USACO: Shopping Offers

Shopping Offers<br />IOI'95<br />In a certain shop, each kind of product has an integer price. For example, the price of a flower is 2 zorkmids (z) and the price of a vase is 5z. In order to attract more customers, the shop introduces some special offers.

2011-01-03 00:22:00 354

原创 USACO: Cheering Up the Cows

Cheering Up the CowsTime Limit(Common/Java):1000MS/10000MS     Memory Limit:65536KByteTotal Submit: 10            Accepted: 3DescriptionFarmer John has grown so lazy that he no longer wants to continue maintaining the cow paths that currently provide a w

2011-01-02 16:50:00 327

原创 memset

对字符串:char str[20];memset(str, '/0', sizeof(str));对其他类型:object obj;memset(&obj, 0, sizeof(object));同样,可以对数组(因为这片内存是连续的):const int size = 100;object objArray[size];memset(objArray, 0, size * sizeof(object));注意,第三个参数实际上是指要重置的连续字节数

2010-12-26 22:08:00 188

原创 各数据类型常用的stdio格式

紧接上一篇,贴一下各种数据类型的stdio格式,这东西其实挺麻烦记的数据类型名称字节数别名stdio基本说明格式int*signed, signed int%d, %iunsigned int*unsigned%u, %o, %x, %X    __int81char, signed char%hhd__int162short, short int, signed short int%hd__int324long, long int, signed long int%ld, (%I32d)__int648l

2010-12-26 20:08:00 461

原创 C语言基本类型详解

刚刚看到一个博客上贴了这个,解决了我一直以来的疑问:int和long是不是一样的?答案是:不确定。转载自:http://itnewsvendor.appspot.com/2379028-int_long_unsigned.html数据类型名称字节数别名取值范围int*signed,signed int由操作系统决定,即与操作系统的"字长"有关unsigned int*unsigned由操作系统决定,即与操作系统的"字长"有关    __int81char,signed char–128 到 127__int

2010-12-26 16:30:00 276

原创 USACO: Riding the Fences

Riding the Fences<br /><br />Farmer John owns a large number of fences that must be repaired annually. He traverses the fences by riding a horse along each and every one of them (and nowhere else) and fixing the broken parts. <br />Farmer John is as lazy a

2010-12-26 15:31:00 299

原创 USACO: Sweet Butter

Sweet ButterGreg Galperin -- 2001<br />Farmer John has discovered the secret to making the sweetest butter in all of Wisconsin: sugar. By placing a sugar cube out in the pastures, he knows the N (1 <= N <= 500) cows will lick it and thus will produce s

2010-12-25 18:58:00 243

原创 USACO: Magic Squares

Magic SquaresIOI'96Following the success of the magic cube, Mr. Rubik invented its planar version, called magic squares. This is a sheet composed of 8 equal-sized squares: 12348765In this task we consider the version where each square has a different color

2010-12-25 02:57:00 193

原创 USACO: Feed Ratios

Feed Ratios<br />1998 ACM Finals, Dan Adkins<br />Farmer John feeds his cows only the finest mixture of cow food, which has three components: Barley, Oats, and Wheat. While he knows the precise mixture of these easily mixable grains, he can not buy that mi

2010-12-24 20:20:00 239

原创 USACO: Stringsobits

StringsobitsKim SchrijversConsider an ordered set S of strings of N (1 This set of strings is interesting because it is ordered and contains all possible strings of length N that have L (1 Your task is to read a number I (1

2010-12-23 21:23:00 272

原创 USACO: Factorials

Factorials<br /><br />The factorial of an integer N, written N!, is the product of all the integers from 1 through N inclusive. The factorial quickly becomes very large: 13! is too large to store in a 32-bit integer on most computers, and 70! is too large

2010-12-22 01:53:00 221

原创 USACO: Contact

Contact<br />IOI'98<br />The cows have developed a new interest in scanning the universe outside their farm with radiotelescopes. Recently, they noticed a very curious microwave pulsing emission sent right from the centre of the galaxy. They wish to know i

2010-12-22 00:46:00 423

原创 USACO: Shaping Regions

Shaping Regions<br />N opaque rectangles (1 <= N <= 1000) of various colors are placed on a white sheet of paper whose size is A wide by B long. The rectangles are put with their sides parallel to the sheet's borders. All rectangles fall within the borders

2010-12-21 19:52:00 208

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除