原创 POJ 3104 Drying 二分

http://poj.org/problem?id=3104 題目大意: 有n件衣服,每件有ai的水,自然風乾每分鐘少1,而烘乾每分鐘少k。求全部弄乾的最短時間。 思路: 注意烘乾時候沒有自然風乾。 可以理解爲烘乾時每分鐘掉(k-1)的水

原创 解決vmware 和hyper-v不能共存的問題

只需在 Windows 中以管理員身份運行命令提示符 cmd 1、運行 bcdedit /copy {current} /d "Windows 8 (關閉 Hyper-V)"命令,隨後會提示已經創建了另外一個啓動菜單項,記下 { } 中的

原创 FZU Problem 2062 Suneast & Yayamao

http://acm.fzu.edu.cn/problem.php?pid=2062 題目大意: 給你一個數n,要求求出用多少個數字可以表示1~n的所有數。 思路: 分解爲二進制。 對於一個數n,看它二進制有多少位即可。 #includ

原创 推廣一下新Blog www.hrwhisper.me

新博客地址:www.hrwhisper.me 歡迎互訪加友鏈~

原创 leetcode Verify Preorder Serialization of a Binary Tree

One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the nod

原创 leetcode Reconstruct Itinerary

leetcode Reconstruct Itinerary Given a list of airline tickets represented by pairs of departure and arrival airports 

原创 leetcode Remove Duplicate Letters

Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and o

原创 leetcode Maximum Product of Word Lengths

Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not sh

原创 leetcode Power of Three

Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using a

原创 leetcode Wiggle Sort II

Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... Example: (1) Given nums

原创 leetcode Count of Range Sum

Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive. Range sum S(i, j) 

原创 leetcode Burst Balloons

Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You

原创 leetcode Patching Array

題意:給定一個數組nums和一個數n,求添加最少的數使得[1,n]中的每個數都可以由數組中元素和組成用known_sum表示已知的連續和爲[1,known_sum),有了這個表示那就簡單了: nums[i] <= known_su

原创 leetcode Longest Increasing Path in a Matrix

題意:給定一個矩陣,在裏面找出最大上升路徑 int dx[] = { 1 , -1, 0 , 0 }; int dy[] = { 0 , 0 , 1 , -1 }; class Solution { public: int dfs(i

原创 leetcode Bulb Switcher

leetcode Bulb Switcher There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off e