![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
acm-其他
文章平均质量分 80
maverick1990
这个作者很懒,什么都没留下…
展开
-
poj 1009 Edge Detection
分类:其他 难度:2 题意:给定一张图的每行长度w,及每个点的像素值,以(像素值,持续长度)对表示,求每个像素和周围8个点的差值绝对值的最大值,结果依然以(像素值,持续长度)表示,点数[2,1e9],给定(像素值,持续长度)对的上限为1000对 通过点数的范围可知,这道题不能用O(n)算法遍历,超时;也不能把每个像素点单个存储,超内存。开始考虑对于一个持续长度为len的像素,可知若len原创 2013-04-07 21:18:53 · 1304 阅读 · 0 评论 -
Google中国2015校园招聘笔试Round D APAC Test Problem D. Itz Chess
Problem Given an arranged chess board with pieces, figure out the total number of different ways in which any piece can be killed in one move. Note: in this problem, the pieces can be killed despite原创 2014-11-14 14:50:40 · 1216 阅读 · 0 评论 -
leetcode-Container With Most Water
Container With Most Water Total Accepted: 11787 Total Submissions: 38592My Submissions Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai)原创 2014-07-05 23:33:29 · 777 阅读 · 0 评论 -
leetcode-3Sum Closest
转自:http://www.cnblogs.com/remlostime/archive/2012/10/27/2742667.html Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return th转载 2014-03-24 22:59:17 · 1072 阅读 · 0 评论 -
leetcode-LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the value (will always be positive) of the key if原创 2014-04-16 13:41:27 · 753 阅读 · 0 评论 -
wikioi-天梯-提高一等-哈希表-2144:砝码称重2
题目描述 Description 有n个砝码,现在要称一个质量为m的物体,请问最少需要挑出几个砝码来称? 注意一个砝码最多只能挑一次 输入描述 Input Description 第一行两个整数n和m,接下来n行每行一个整数表示每个砝码的重量。 输出描述 Output Description 输出选择的砝码的总数k,你的程原创 2014-02-18 22:08:33 · 1327 阅读 · 0 评论 -
TopCoder SRM 598 Div1 第1题
Problem Statement Fox Ciel has some items. The weight of the i-th (0-based) item is item[i]. She wants to put all items into bins. The capacity of each bin is 300. She can put an a原创 2013-12-02 20:20:27 · 991 阅读 · 0 评论 -
Google中国2014校园招聘笔试Round B China New Grad Test Problem B. Meet and party
Problem Little Sin lives in a Manhattan-grid city, a 2D plane where people can only go north, west, south or east along the grid. The distance from (x1, y1) to (x2, y2) is |x1 - x2| + |y1 - y2|. L原创 2013-10-16 12:39:54 · 2291 阅读 · 0 评论 -
Google中国2014校园招聘笔试Round A China New Grad Test Problem A. Read Phone Number
Problem Do you know how to read the phone numbers in English? Now let me tell you. For example, In China, the phone numbers are 11 digits, like: 15012233444. Someone divides the numbers into 3-4-4 f原创 2013-09-25 12:37:06 · 2680 阅读 · 0 评论 -
poj 2419 Forests
分类:其他 难度:1 题意:给出p,t两个数,p个人,t棵树,给出一堆i,j两个数的集合,表示第i个人听到第j棵树倒下。听到倒下的树的集合完全相同的人为一组,问有几组人 分析: 解法一:简单思路,给一个矩阵re[100][100],re[i][j]存储第i个人听到第j棵树倒下,然后遍历每两个人,比较是否相同,时间复杂度O(p^2 * t),空间复杂度O(p*t) 解法二:考虑每原创 2013-08-26 19:09:51 · 1448 阅读 · 0 评论 -
Google Code jam 2013 Round 1B A题
分类:其他 难度:2 Problem Armin is playing Osmos, a physics-based puzzle game developed by Hemisphere Games. In this game, he plays a "mote", moving around and absorbing smaller motes. A "mote" in Englis原创 2013-05-05 23:56:34 · 1156 阅读 · 0 评论 -
poj 1142 Smith Numbers
分类:其他 难度:1.5 题意:将一个数各个位的和,与因式分解的每个因数各个位的和,如相等,为smith数,4937775= 3*5*5*65837,4+9+3+7+7+7+5= 42, 3+5+5+6+5+8+3+7=42。求大于给出的n的最小smith数。因式分解,map记录因式分解结果,map[因数]=出现次数。 #include #include using namespac原创 2013-04-10 19:33:35 · 844 阅读 · 0 评论 -
Google中国2015校园招聘笔试Round D APAC Test Problem C. Sort a scrambled itinerary
Problem Once upon a day, Mary bought a one-way ticket from somewhere to somewhere with some flight transfers. For example: SFO->DFW DFW->JFK JFK->MIA MIA->ORD. Obviously, transfer flights at a原创 2014-11-14 11:44:02 · 1526 阅读 · 0 评论