原创 利用hash求最長公共子串的長度
#include<cstdio> #include<iostream> #include<string.h> #include<queue> #include<vector> #include<algorithm> #includ
原创 針對queue的修改bug
#include<cstdio> #include<queue> using namespace std; struct node{ int data; }a[10]; int main(){ queue<int> q; f
原创 dfs最後定的序列練習可重複選數字
#include<cstdio>//dfs的序列練習----可以重複選的情況 #include<vector> using namespace std; const int maxn=50; int a[maxn],n,k,x
原创 dfs剪枝優化
#include<cstdio>//”剪枝 “優化後的dfs算法!非極端情況下有很好的表現! const int maxn=30; int n,v,maxvalue=0; int w[maxn],c[maxn]; void df
原创 bfs練習題1
#include<cstdio> #include<queue> using namespace std; const int maxn=100; struct node{ int x,y; }Node;//Node是一個nod
原创 17 機器學習案例——基於樸素貝葉斯算法的文本分類(垃圾郵件過濾)
from sklearn import datasets from sklearn.feature_extraction.text import CountVectorizer from sklearn.naive_bayes i
原创 bfs練習迷宮最小步數
#include<cstdio> #include<cstring> #include<queue> using namespace std; const int maxn=100; struct node{ int x,y;
原创 dfs最後定的序列練習
#include<cstdio> #include<vector> using namespace std; const int maxn=50; int a[maxn],n,k,x,maxsumsqu=-1; vector<i
原创 8.5 依存關係 和 依存文法 & 8.6 文法開發
8.5 依存關係 和 依存文法 & 8.6 文法開發8.5 依存關係 和 依存文法1、配價 與 詞彙2、擴大規模8.6 文法開發1、樹庫 和 文法2、有害的歧義3、加權文法 #!/usr/bin/env python # codi
原创 dfs學習
#include<cstdio>//未優化之前複雜度O(2^n) const int maxn=30; int n,v,maxvalue=0; int w[maxn],c[maxn]; void dfs(int index,in
原创 bfs練習題1改成dfs
#include<cstdio> #include<queue> using namespace std; const int maxn=100; struct node{ int x,y; }Node;//Node是一個nod
原创 19 詞雲實戰——爬取豆瓣影評生成詞雲
詞雲實戰20.2 程序設計的思路20.3 關鍵技術· 使用WordCloud20.4 源代碼1、抓取網頁數據2、數據清洗3、用詞雲進行顯示4、完整程序代碼(取前二十頁評論) #!/usr/bin/env python # codi
原创 8.1 一些語法困境
一些語法困境1、一種簡單的文法2、編寫自己的文法3、句法結構中的遞歸 #!/usr/bin/env python # coding: utf-8 1、一種簡單的文法 ·上下文無關文法CFG # In[7]: get_ipyt
原创 任務二 利用wireshark抓圖(發現中國地圖中的flag!!!)
利用wireshark抓圖一、步驟二、找到其中的flag 任務描述:從抓到的包文件pcpa中解析出一張圖片來。 一、步驟 1、在過濾器的搜索欄中輸入http,找出所有通過http傳輸的包 2、發現其中有一個包是有圖片image格
原创 A1011 Worldcup 大神&自練代碼
自練代碼 #include<cstdio> int main(){ int n=3,i,j; float w,t,l,a[3],b,c; char m[3]; for(i=0;i<3;i++){ scanf("%f %