原创 Leetcode Combination Sum II

題目: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the

原创 Codeforces Round #268 (Div. 2) 解題報告

爲嘛每次D題圖論的都過不了,難道3年沒搞acm就退化成這樣了。 A題I Wanna Be the Guy 暴力,坑爹,輸出格式不對,WA了兩次 = =! B題Chat Online 暴力搞,這個數據範圍能過 C題24 Game 給

原创 windows與linux相互telnet/ssh

唉,windows主機想telnet到Linux上,搞了好一會,各種問題,不過,生命在於折騰嘛。 windows主機和linux主機都是一個大局域網內的主機 windows ip: 172.16.216.231  linux ip:172

原创 linux 虛擬機設置混合模式上網

內部虛擬機通過宿主機的網卡上網 1.首先,假設內部虛擬機網絡已經連通,假設external net網段爲172.16.0.0/24 2.將external net網段與br-ex相連,br-ex爲虛機的出口網卡 sudo ip addr

原创 fork()、 vfork()、 clone()的區別

原文地址:http://blog.chinaunix.net/uid-27164517-id-3281349.html 首先說明Linux下的進程與線程比較相近。這麼說的一個原因是它們都需要相同的數據結構來表示,即task_struct。

原创 硬中斷與軟中斷的區別

硬中斷: 1. 硬中斷是由硬件產生的,比如,像磁盤,網卡,鍵盤,時鐘等。每個設備或設備集都有它自己的IRQ(中斷請求)。基於IRQ,CPU可以將相應的請求分發到對應的硬件驅動上(注:硬件驅動通常是內核中的一個子程序,而不是一個獨立的進程)

原创 Leetcode Trapping Rain Water

題目: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much wa

原创 Codeforces Round #267 (Div. 2) 解題報告

N久沒做過cf了,今天心血來潮搞了一個,唉,坑爹的D題,卡了N久 解題: A題George and Accommodation 直接暴力 B題Fedor and New Game 也是直接暴力 C題George and Jo 題目:

原创 Leetcode Palindrome Partitioning II

題目: Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cut

原创 Leetcode Reverse Nodes in k-Group

題目: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number

原创 Linux 不同網段兩臺主機相互ping通

剛起的虛擬機無法相互ping通,屬於兩個網段,中間通過路由相連接 比如:10.11.12.202 ping 10.11.13.102 首先,ssh到10.11.12.202中, route -n 查看路由表項,發現沒有默認路由: D

原创 電腦從開機加電到操作系統main函數之前執行的過程

總的來說在操作系統加電啓動之後到main函數執行之前操作系統經歷了以下3個大步驟 1.啓動BIOS。這個時候位於實模式下,加載中斷向量和中斷服務程序 2.加載操作系統內核併爲保護模式做準備。這個時候操作系統一共加載了3部分代碼:引導程序b

原创 Leetcode ump Game II

題目: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each elem

原创 Leetcode Palindrome Partitioning

題目: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible

原创 Leetcode Anagrams

題目: Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-cas