原创 題目1 : Magic Box【微軟2016校園招聘在線筆試】

時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 The circus clown Sunny has a magic box. When the circus is performing, Sunn

原创 [HiHoCoder]二分·歸併排序之逆序對

時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 在上一回、上上回以及上上上回裏我們知道Nettle在玩《艦これ》。經過了一番苦戰之後,Nettle又獲得了的很多很多的船。 這一天Nettle在檢查自

原创 [LeetCode]House Robber

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed

原创 題目2 : Professor Q's Software【微軟2016校園招聘在線筆試】

時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 Professor Q develops a new software. The software consists of N modules whi

原创 java程序員面試32問

第一,談談final, finally, finalize的區別。   第二,Anonymous Inner Class (匿名內部類) 是否可以extends(繼承)其它類,是否可以implements(實現)interface(接口)

原创 [LeetCode]Number of Islands

Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water a

原创 Java的內存泄漏

Java的一個重要優點就是通過垃圾收集器(Garbage Collection,GC)自動管理內存的回收,程序員不需要通過調用函數來釋放內存。因此,很多程序員認爲Java不存在內存泄漏問題,或者認爲即使有內存泄漏也不是程序的責任,而是GC

原创 [LeetCode]Binary Tree Right Side View

Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see or

原创 [HiHoCoder]三分·三分求極值[hiho一下 第四十週]

時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 在直角座標系中有一條拋物線y=ax^2+bx+c和一個點P(x,y),求點P到拋物線的最短距離d。 提示:三分法 輸入 第1行:5個整數a

原创 Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substri

原创 [HiHoCoder]#1051 : 補提交卡

#1051 : 補提交卡 時間限制:2000ms 單點時限:1000ms 內存限制:256MB 描述 小Ho給自己定了一個宏偉的目標:連續100天每天堅持在hihoCoder上提交一個程序。100天過去了,小Ho查看自

原创 Reverse Linked List

Reverse a singly linked list. 遞歸方法 /** * Definition for singly-linked list. * public class ListNode { * int val

原创 windows下eclipse中gdb調試輸出stl容器的內容(終極解決方案)

摸索了一天終於把這個問題搞定了 首先下載MinGw 地址:http://sourceforge.net/projects/mingw/?source=directory 下載完之後安裝G++,在安裝程序中步驟如下 之後利用CMD安裝g

原创 [華爲機試]朋友圈信息轉發

朋友圈轉發信息 描述: 在一個社交應用中,兩個用戶設定朋友關係後,則可以互相收到對方發佈或轉發的信息。當一個用戶發佈或轉發一條信息時,他的所有朋友都能收到該信息。   現給定一組用戶,及用戶之間的朋友關係。 問:當某用戶發佈一條信息

原创 Reverse Integer

Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers.