原创 【論文研讀】Relation Classification via Convolutional Deep Neural Network

核心: 用卷積神經網絡提取詞語和語句級別的特徵,將所有的單詞標註作爲輸入(無預處理操作)。通過word embedding將單詞標記轉換爲向量,根據給定的名詞提取詞彙級別的特徵,同時使用卷積神經網絡學習語句級特徵。連接兩個級別的特徵形

原创 【LeetCode系列】22 Generate Parentheses 生成括號

題目描述:LeetCode原題地址 Given n pairs of parentheses, write a function to generate all combinations of well-formed parenthe

原创 【筆試系列】輸入輸出處理C++(持續更新)

1. 輸入一行個數不確定的數 輸入的每個整數之間用空格隔開,個數不確定。 輸入:3 4 1 2 輸出:24 #include<bits/stdc++.h> using namespace std; int main() {

原创 【LeetCode系列】21 Merge Two Sorted Lists 合併兩個有序鏈表

題目描述:LeetCode原題地址 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing

原创 【LeetCode系列】20 Valid Parentheses 有效括號

題目描述:LeetCode原題地址 Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the inp

原创 【LeetCode系列】Day13 移除鏈表倒數第N個結點 Remove Nth Node From End of List

題目描述:LeetCode原題地址 Given a linked list, remove the n-th node from the end of list and return its head. 給定一個鏈表,移除從列表尾部開

原创 【LeetCode】Day12 電話號碼的字母組合 Letter Combinations of a Phone Number

題目描述: LeetCode原題地址 Given a string containing digits from 2-9 inclusive, return all possible letter combinations that

原创 【LeetCode系列】Day11 三數之和等於固定數 3Sum

題目描述: LeetCode題目原地址 Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Fi

原创 【LeetCode系列】Day10 盛水最多問題 Container With Most Water

題目描述: LeetCode地址 Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n

原创 Google: Kick Start 2018 Round A: Even Digits偶數字

Even Digits題目描述題目分析小數量級大數量級題目解答練習提交 題目描述 先附上原題網站:Competition Interface - Kick Start 2018 - Round A - Even Digits(包含分析

原创 【LeetCode系列】Day5 最長共同前綴 Longest Common Prefix

C語言解法:char* longestCommonPrefix(char** strs, int strsSize) { char* temp = strs[0]; //臨時指針變量指向第一個字符串,以第一個字符串爲標準依次判斷後

原创 【LeetCode系列】Day2 反轉整數 Reverse Integer

題目要求很簡單,就是翻轉整數。唯一需要留意的地方是題目中提到假設只能存儲32位的整數,也就是說在判斷是否溢出時不能用long類型的變量來判斷是否溢出。解決方式如下:class Solution { public:     int reve

原创 【LeetCode系列】 Day1 兩數之和 Two Sum

題目:給定一個整數數組和一個目標值,找出數組中和爲目標值的兩個數。你可以假設每個輸入只對應一種答案,且同樣的元素不能被重複利用。我的解答:兩個循環嵌套,暴力解答,時間複雜度爲O(n²)。class Solution { publi

原创 【實驗樓挑戰】Python3簡明教程:玩轉函數

目標:實現一個函數 Hours(),將用戶輸入的 分鐘數 轉化爲 小時數和分鐘數,並要求小時數儘量大。將結果以 XX H, XX M 的形式打印出來。(注意打印格式中的空格)要求:用戶能夠通過命令行輸入分鐘數,程序需要打印出相應的小時數和

原创 【實驗樓筆記】Python中的切片

設有一個列表:s = [1, 2, 3, 4]切片的索引省略的第一個索引默認爲零,省略的第二個索引默認爲切片的字符串的大小。切片時的索引是在兩個元素之間 。左邊第一個元素的索引爲 0,而長度爲 n 的列表其最後一個元素的右界索引爲 n。例