随笔分类 -  Algorithm

摘要:Time Limit:10000ms Case Time Limit:1000ms Memory Limit:256MB Time Limit:10000ms Case Time Limit:1000ms Memory Limit:256MB Description 在图像处理的技术中,经常会用到算 阅读全文
posted @ 2016-09-04 14:37 HaruHaru 阅读(268) 评论(0) 推荐(0)
摘要:DescriptionWPH has a triangle whose three edges are of length a, b, c.He has super power to enlarge the edges, but the total length that was enlarged ... 阅读全文
posted @ 2015-11-02 13:50 HaruHaru 阅读(209) 评论(0) 推荐(0)
摘要:DescriptionTo prepare for the English exam Little Ho collected many digital reading materials. Unfortunately the materials are messed up by a malware.... 阅读全文
posted @ 2015-10-28 12:56 HaruHaru 阅读(923) 评论(0) 推荐(0)
摘要:DescriptionThere is a tower defense game with n levels(missions). The n levels form a tree whose root is level 1.In the i-th level, you have to spend ... 阅读全文
posted @ 2015-10-27 22:06 HaruHaru 阅读(252) 评论(0) 推荐(0)
摘要:DescriptionLittle Hi is studying on memory allocating algorithms this summer. He starts his experiments with a very simple algorithm. By this algorith... 阅读全文
posted @ 2015-10-27 17:33 HaruHaru 阅读(341) 评论(0) 推荐(0)
摘要:DescriptionGiven an n*n grid with non-negative integers, you start from the upper left corner (1,1) and can only move right or down.Your task is to fi... 阅读全文
posted @ 2015-10-12 19:30 HaruHaru 阅读(310) 评论(0) 推荐(0)
摘要:DescriptionLittle Hi and Little Ho are playing a construction simulation game. They build N cities (numbered from 1 to N) in the game and connect them... 阅读全文
posted @ 2015-10-12 12:19 HaruHaru 阅读(424) 评论(0) 推荐(0)
摘要:DescriptionA fancy square image encryption algorithm works as follow:0. consider the image as an N x N matrix1. choose an integer k∈ {0, 1, 2, 3}2. ro... 阅读全文
posted @ 2015-10-11 20:00 HaruHaru 阅读(226) 评论(0) 推荐(0)
摘要:DescriptionA base station has to be built on an N × M grid to serve the users in it.There are A users in the grid. The cost of serving a user is the s... 阅读全文
posted @ 2015-08-22 10:59 HaruHaru 阅读(298) 评论(0) 推荐(0)
摘要:DescriptionGiven a string, calculate the number of subsequences that are palindrome. A palindrome is a sequence of characters that reads the same back... 阅读全文
posted @ 2015-08-18 23:35 HaruHaru 阅读(326) 评论(0) 推荐(0)
摘要:DescriptionYou are givena txt file, which is performance logs of a single-threaded program.Each line has three columns as follow:[Function Name] [Time... 阅读全文
posted @ 2015-08-17 20:13 HaruHaru 阅读(213) 评论(0) 推荐(0)
摘要:DescriptionThe numberic keypad on your mobile phone looks like below:1 2 34 5 67 8 9 0Suppose you are holding your mobile phone with single hand. You... 阅读全文
posted @ 2015-08-16 23:51 HaruHaru 阅读(402) 评论(0) 推荐(0)
摘要:DescriptionRecently Little Hi started to like astronomy and downloaded the pictures of K constellations. He wonders how many of them he can spot in th... 阅读全文
posted @ 2015-04-07 17:08 HaruHaru 阅读(362) 评论(1) 推荐(0)
摘要:DescriptionEveryday Littile Hi and Little Ho meet in the school cafeteria to have lunch together. The cafeteria is often so crowded that two adjacent ... 阅读全文
posted @ 2015-04-07 13:05 HaruHaru 阅读(323) 评论(0) 推荐(0)
摘要:DescriptionGiven a directed graph containing n vertice (numbered from 1 to n) and m edges. Can you tell us how many different Hamiltonian Cycles are t... 阅读全文
posted @ 2015-04-06 20:02 HaruHaru 阅读(599) 评论(0) 推荐(0)
摘要:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2015-04-06 14:52 HaruHaru 阅读(168) 评论(0) 推荐(0)
摘要:传送门:hihoCoder #1086 Browser Caching实现 LRU(Least Recently Used) Cache 即可参考:http://www.cs.uml.edu/~jlu1/doc/codes/lruCache.htmlSolution: 1 #include 2... 阅读全文
posted @ 2015-03-27 17:14 HaruHaru 阅读(412) 评论(0) 推荐(0)
摘要:DescriptionYou are given two sequences a and b which may contain repeated numbers. A pair (i,j) is good when aiis picked from the first sequence and b... 阅读全文
posted @ 2015-03-25 18:32 HaruHaru 阅读(270) 评论(0) 推荐(0)
摘要:传送门http://hihocoder.com/problemset/problem/1036Solution: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 struct Nod... 阅读全文
posted @ 2015-03-19 20:53 HaruHaru 阅读(164) 评论(0) 推荐(0)
摘要:Problem:DescriptionYour task is to judge whether the input is a legal regular expression.A regular expression is defined as follow:1: 0 and 1 are both... 阅读全文
posted @ 2015-03-08 20:38 HaruHaru 阅读(323) 评论(0) 推荐(0)