原创 OJ 赫夫曼編碼

描述先從鍵盤輸入若干電文所用符號及其出現的頻率,然後構造赫夫曼樹,從而輸出赫夫曼編碼。注意:爲了保證得到唯一的赫夫曼樹,這裏規定在構造赫夫曼樹時,左孩

原创 MYSQL的SQL優化,多表連接後有order by排序,出現Using temporary; Using filesort情況

使用EXPLIAN字段可以對sql語句進行分析,當extra有Using temporary; Using filesort等時表示需要進行優化,意思分別是用了臨時表和一種sql的排序。 eg1: select * from a inne

原创 springBoot傳list類型的注意

list = JSON.stringify(list); // layer.msg(JSON.stringify(list)) layer.confirm('確認要刪除嗎?' , functio

原创 PAT 甲級 1001 A+B Format

開兩個數組,一個存數字,一個存逗號,一開始用遞歸快點寫了,發現逗號不好處理改用2個數組做了#include <iostream> #include "cstring" #include <stdio.h>

原创 PAT 甲級 1005. Spell It Right (遞歸)

Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the s

原创 PAT 甲級 1011. World Cup Betting (20)

#include <iostream> #include "cstring" #include <stdio.h> #include "iomanip" #include "vector" #include "cmath" #includ

原创 OJ kruskal算法求最小生成樹

總時間限制: 10000ms單個測試點時間限制: 1000ms內存限制: 65536kB描述要求對一個圖使用kruskal算法求最小生成樹,依次輸出選出的邊所關聯的頂點序列,要求下標較小者在前,如圖所示,其頂點序列爲1 3 4 6 2 5

原创 PAT 甲級 1002 A+B for Polynomials

This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case.

原创 六度空間 (bfs,廣度優先)

7-9 六度空間(30 分)“六度空間”理論又稱作“六度分隔(Six Degrees of Separation)”理論。這個理論可以通俗地闡述爲:“你和任何一個陌生人之間所間隔的人不會超過六個,也就是說,最多通過五個人你就能夠認識任何一

原创 openjudge 攔截導彈 (DP 動態規劃)

樣例輸入8 389 207 155 300 299 170 158 65樣例輸出6當整個數組位遞增序列時候輸出1,所以用來記錄最大值maxx=1,不然會輸出0,卡在這裏好久,dp寫的沒錯,但是ac不了,後來對比別人的代碼,發現問題,還有一

原创 OJ 4127:迷宮問題 遞歸輸出路徑

描述定義一個二維數組: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, };它表示一個

原创 PAT 甲級 1009. Product of Polynomials (Map)

This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:Each input file contains

原创 PAT 甲級 1006. Sign In and Sign Out

測試用例Sample Input:3 CS301111 15:30:28 17:00:10 SC3021234 08:00:00 11:25:25 CS301133 21:45:00 21:58:40 Sample Output:SC30

原创 PAT 甲級 1003. Emergency 使用 優先隊列 dijkstra 算法

As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scatte

原创 OJ 3752:走迷宮 bfs

總時間限制: 1000ms內存限制: 65536kB描述一個迷宮由R行C列格子組成,有的格子裏有障礙物,不能走;有的格子是空地,可以走。給定一個迷宮,求從左上角走到右下角最少需要走多少步(數據保證一定能走到)。只能在水平方向或垂直方向走,