標籤:K短路模板題.K很小所以A*就可以過了./* I will wait for you */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <ctime>#include <algorithm>#include <iostream>#include <fstream>#include
標籤:參考:http://www.cnblogs.com/Anker/p/3265058.htmlselect /* According to POSIX.1-2001 */ #include <sys/select.h> /* According to earlier standards */ #include <sys/time.h> #include <sys/types.h>
標籤:題目:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.代碼:/** * Definition
標籤:《See You Again》是由美國饒舌歌手Wiz Khalifa和新人查理·普斯共同演唱的一首歌曲 ,於2015年3月17日發行,收錄於電影《速度與激情7》的原聲帶中,作為該電影的片尾曲和主題曲。歌曲由DJ Frank E、查理·普斯、維茲·卡利法和安德魯·希達爾共同譜寫完成,DJ Frank
標籤:今天做了大量的canvas作業,發現很多的步奏都是一樣的,我自己就封裝了一個畫直線形2D圖形函數。功能不是很強大。 function drawModule(Json,strokeStyle,fillStyle) { if (fillStyle) { context.fillStyle = fillStyle; } if (strokeStyle) { context.strokeStyle
標籤:Grammerforget-forgotforget, 過去式為forgot, 意為“忘記”,常用於:1. forget sth. 忘記某事/東西2. forget to do sth 忘記去做某事(事情沒有做)3. forget doing sth 忘記做了某事(事情已經做了,但是忘記做過這件事)Example: I forgot my phone! 我忘帶手機了。Example: Jane forgot to bring the map.
標籤:Given a singly linked list, determine if it is a palindrome.思路: 用快慢指標找到鏈表中點,反轉後半部分鏈表,然後與前半部分進行匹配,隨後將鏈表恢複原狀(本題沒有這個要求,具體情況具體對待)。C++: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6
標籤:寫的是區間線段樹套權值線段樹.似乎比反過來寫要麻煩.SAD.為了節省記憶體.內層的線段樹要動態開點./* I will wait for you */ #include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <ctime>#include <algorithm>#include