LeetCode: Single Number,leetcodesingle這幾天找實習被打擊的太厲害了,從今天開始修鍊演算法。在Leetcode找了半天,只有這一道題會,順手AC掉。題目描述:有一個數組,裡面的數幾乎都是成對出現的,但有一個數只有一個,你的任務就是找出這個單個的數。思路:按位異或直接搞定。貼上代碼吧,特別簡單public class Solution { public int singleNumber(int[] A) { for(int i=1; i
POJ--2063--Investment--背包,002063股吧InvestmentTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 8733 Accepted: 2984DescriptionJohn never knew he had a grand-uncle, until he received the notary's letter. He learned
Oulipo(poj3461)(KMP),oulipopoj3461kmpOulipoTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 25172 Accepted: 10107DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without
POJ 2367 Genealogical tree 拓撲排序,pojgenealogicalDescriptionThe system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. They gather together in different groups, so that a Martian can have