
解题报告
文章平均质量分 80
snape3058
这个作者很懒,什么都没留下…
展开
-
1002 Roman numerals
第一次写解题报告,选了一道目前做过的最简单的题,就当是练手了 1002 Roman numerals:http://acm.bit.edu.cn/mod/programming/view.php?a=488 Roman numerals 时间限制: 1秒 内存限制: 64M Problem Description Now let’s think ab原创 2013-01-30 11:02:59 · 743 阅读 · 0 评论 -
关于qsort的比较函数的不同写法对于大数据造成的错误
关于qsort的比较函数的不同写法对于大数据造成的错误 先看一下这两份代码: 代码1:AC #include #include #include #include using namespace std; #define N 5050 int p[N]; double point[2][110]; struct road { int a, b; double dis; }node[N原创 2013-07-16 01:46:11 · 819 阅读 · 0 评论 -
1060 Is It A Tree?
1060 Is It A Tree? Is It A Tree? 时间限制: 1秒 内存限制: 10240KB Description A 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 · 393 阅读 · 0 评论 -
1020 小白鼠:哈夫曼树
1020 小白鼠 小白鼠 时间限制: 1秒 内存限制: 64M Description 有 n 个瓶子,已知其中有且仅有一个瓶子的饮料有毒。现在我们想知道哪个瓶子的饮料有毒,于是找来一些小白鼠做测试。 假设我们有足够多的小白鼠,为了加快测试速度,我们每次可以把来自若干个瓶子的测试样本混在一起,喂给小白鼠。如果小白鼠喝了有毒的饮料,即死。 现在给你每个瓶子的饮料有毒的概原创 2013-02-07 11:05:03 · 481 阅读 · 0 评论 -
1030 Knight Moves:BFS
宽度优先搜索(BFS) 上一次吧DFS错当成BFS写了一篇解题报告,哎呀囧啊。幸好没人发现。 言归正传,先上一道例题 1030 Knight Moves Knight Moves 时间限制: 1秒 内存限制: 64M Description A friend of you is doing research on the Traveling Knight原创 2013-02-05 13:17:57 · 419 阅读 · 0 评论 -
1038 Red and Black
1038 Red and Black Red and Black 时间限制: 1秒 内存限制: 64M Description There 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 · 517 阅读 · 1 评论 -
1008 Putting Apples
1008 Putting Apples Putting Apples 时间限制: 1秒 内存限制: 64M Problem Description If 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 · 429 阅读 · 0 评论 -
1009 Number Sequence
1009 Number Sequence Number Sequence 时间限制: 1秒 内存限制: 64M Problem Description A 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 · 416 阅读 · 0 评论 -
1003 Exchange for Cola
1003 Exchange for Cola Exchange for Cola 时间限制: 1秒 内存限制: 64M Problem Description The Cola company is holding a promotional activity that customerscan exchange B bottles of Cola with A caps原创 2013-01-31 14:07:12 · 466 阅读 · 0 评论 -
1007 Number Converter
1007 Number Converter Number Converter 时间限制: 1秒 内存限制: 64M Problem Description As 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 · 349 阅读 · 0 评论 -
关于按位异或用于抵消成对出现的数据
给n个数 其中n-1个数出现了两次 只有一个数出现了一次,找到它并输出 一组测试,输入n个数,均可用int表示 n 由于0^0为0,0^1为1,所以0按位异或任何数都是这个数字本身; 对于两个相同的数字,由于每一位都相同,所以这两个数的按位异或为0,于是就抵消了; 当数字不是按照两个相同数字连在一起给出时,会有以下几种情况: ans = 0^n1原创 2013-11-10 16:34:29 · 782 阅读 · 0 评论