上一页 1 ··· 4 5 6 7 8 9 10 下一页
摘要: 给出一个有序数组A[0...n-1]和一个值key,返回key在A[]中的位置或者不存在,要求log n复杂度。C标准库中有一个bsearch(),原型为:void * bsearch ( const void * key, const void * base, size_t num, size_t... 阅读全文
posted @ 2013-10-27 13:52 努力变瘦 阅读(159) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1435因为除数是int型以内的,所以直接对被除数扫一遍即可,处理好边界,做好测试就会AC(long long用%lld输出)WA了依次,PE(用%I64d输出)了一次。// 15:51 - 16:14# include # include char d[100005];char op[5];int dr;int main(){ while (scanf("%s%s%d&q 阅读全文
posted @ 2013-10-26 16:32 努力变瘦 阅读(175) 评论(0) 推荐(0) 编辑
摘要: “People were reluctant to use the laptops because they found them a bit cumbersome,” said Gee Bafhtiar, operations director at Comfort Care Services, which provides housing and rehabilitation services for adults with mental illness and other special needs.Some employees didn’t want to wait through t 阅读全文
posted @ 2013-10-26 15:50 努力变瘦 阅读(164) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=406表示用double过的太不像话了……分明是高精度的题嘛输入为两个可能超过int型的非负整数(用a,b表示),运算符只有+和*,那么可以注意到几种需要输出message的情况:1. 如果a和b某一个超过max_int,那么:和一定超过max_int;如果另一个数不为0时,积超max_int;2. 如果a,b都不超max_int,那么可以用long long 来计算出和或者积,然后 阅读全文
posted @ 2013-10-26 15:45 努力变瘦 阅读(161) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/problemset/problem/354/E如果从个位到最高位依次对每一位尝试所有可能(搜索):1. 对每一位,显然4和7出现的顺序无关紧要,只需要考虑个数(预处理出所有可能的组合,如果当前位是x,直接遍历和为x的4和7的个数组合);2. 进位的处理:除最高位外,每一位获得的进位c要从当前位x中减去(c>x时,还要向高位借位,即高位减1),如果最高位完成组合后没有进位则搜索结束。// Lucky Number Representation# include # include using namespace std;int c[10];in 阅读全文
posted @ 2013-10-22 17:35 努力变瘦 阅读(364) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 下一页