解题报告
文章平均质量分 80
snape3058
这个作者很懒,什么都没留下…
展开
-
1002 Roman numerals
第一次写解题报告,选了一道目前做过的最简单的题,就当是练手了1002 Roman numerals:http://acm.bit.edu.cn/mod/programming/view.php?a=488Roman numerals时间限制: 1秒 内存限制: 64MProblem DescriptionNow let’s think ab原创 2013-01-30 11:02:59 · 710 阅读 · 0 评论 -
关于qsort的比较函数的不同写法对于大数据造成的错误
关于qsort的比较函数的不同写法对于大数据造成的错误先看一下这两份代码:代码1:AC#include#include#include#includeusing namespace std;#define N 5050int p[N];double point[2][110];struct road{ int a, b; double dis;}node[N原创 2013-07-16 01:46:11 · 787 阅读 · 0 评论 -
1060 Is It A Tree?
1060 Is It A Tree?Is It A Tree?时间限制: 1秒 内存限制: 10240KBDescriptionA tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes conne原创 2013-02-06 13:46:34 · 382 阅读 · 0 评论 -
1020 小白鼠:哈夫曼树
1020 小白鼠小白鼠时间限制: 1秒 内存限制: 64MDescription有 n 个瓶子,已知其中有且仅有一个瓶子的饮料有毒。现在我们想知道哪个瓶子的饮料有毒,于是找来一些小白鼠做测试。假设我们有足够多的小白鼠,为了加快测试速度,我们每次可以把来自若干个瓶子的测试样本混在一起,喂给小白鼠。如果小白鼠喝了有毒的饮料,即死。现在给你每个瓶子的饮料有毒的概原创 2013-02-07 11:05:03 · 449 阅读 · 0 评论 -
1030 Knight Moves:BFS
宽度优先搜索(BFS)上一次吧DFS错当成BFS写了一篇解题报告,哎呀囧啊。幸好没人发现。言归正传,先上一道例题1030 Knight MovesKnight Moves时间限制: 1秒 内存限制: 64MDescriptionA friend of you is doing research on the Traveling Knight原创 2013-02-05 13:17:57 · 392 阅读 · 0 评论 -
1038 Red and Black
1038 Red and BlackRed and Black时间限制: 1秒 内存限制: 64MDescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing原创 2013-02-04 16:31:03 · 492 阅读 · 1 评论 -
1008 Putting Apples
1008 Putting ApplesPutting Apples时间限制: 1秒 内存限制: 64MProblem DescriptionIf we have n apples and k baskets, and we want to put all the apples into the baskets. We can leave some baskets原创 2013-02-01 16:38:35 · 406 阅读 · 0 评论 -
1009 Number Sequence
1009 Number SequenceNumber Sequence时间限制: 1秒 内存限制: 64MProblem DescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequen原创 2013-01-31 12:02:24 · 403 阅读 · 0 评论 -
1003 Exchange for Cola
1003 Exchange for ColaExchange for Cola时间限制: 1秒 内存限制: 64MProblem DescriptionThe Cola company is holding a promotional activity that customerscan exchange B bottles of Cola with A caps原创 2013-01-31 14:07:12 · 441 阅读 · 0 评论 -
1007 Number Converter
1007 Number ConverterNumber Converter时间限制: 1秒 内存限制: 64MProblem DescriptionAs we know 3 = 11 if we think about the binary representation . Now let’s make a number converter. Given you原创 2013-01-30 16:50:01 · 327 阅读 · 0 评论 -
关于按位异或用于抵消成对出现的数据
给n个数其中n-1个数出现了两次只有一个数出现了一次,找到它并输出一组测试,输入n个数,均可用int表示n由于0^0为0,0^1为1,所以0按位异或任何数都是这个数字本身;对于两个相同的数字,由于每一位都相同,所以这两个数的按位异或为0,于是就抵消了;当数字不是按照两个相同数字连在一起给出时,会有以下几种情况:ans = 0^n1原创 2013-11-10 16:34:29 · 756 阅读 · 0 评论