原创 HDU 2594 Simpsons’Hidden Talents(KMP)
題意:求s1中的最長前綴子串 s2中的最長後綴子串 兩個子串恰好匹配 法一:KMP 將s2看作文本串,s1看作模式串,一直匹配到s2結束; #include<iostream>
原创 HDU5592 ZYB's Premutation 樹狀數組應用
#include<iostream> #include<stdio.h> #include<string> #include<algorithm> using namespace std; int a[50005];//已知數組;
原创 CodeForces 505B Mr. Kitayuta's Colorful Graph
關於昨晚的B題 正常說,水題,深搜或者並查集都能做 然而 是誰說過看了看數據覺得能做就敲代碼了。 要保存錯誤現場的代碼 #include<iostream> #include<cstdio> #include<string>
原创 密碼學之公鑰私鑰
目錄網絡應用中的密碼學之公鑰私鑰簡單瞭解不對稱祕鑰應用生成註冊證書使用下方有較詳細的解釋網絡安全問題網絡安全的基本需求解決方案之祕鑰加密加密原理簡單示例:python之禪對稱祕鑰不對稱祕鑰涉及的問題之祕鑰分發祕鑰破解報文完整性數字
原创 Codeforces 584C Marina and Vasya
先上倆鏈接,過後再來補題 題意理解加分類討論 貪心
原创 CodeForces Round #305 (div1) B. Mike and Feet (單調棧)
題目 本Markdown編輯器使用[StackEdit][6]修改而來,用它寫博客,將會帶來全新的體驗哦: B - Mike and Feet Time Limit:1000MS Memory Limit:2621
原创 HDU 3199 Hamming Problem 醜數
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description Fo
原创 HDU3499 Flight (兩遍dijkstra)
錯誤百出調試多次的代碼 #include<queue> #include<map> #include<string> #include<iostream> #define INF 1e17 #define maxn
原创 歡迎使用CSDN-markdown編輯器
壘骰子 賭聖atm晚年迷戀上了壘骰子,就是把骰子一個壘在另一個上邊,不能歪歪扭扭,要壘成方柱體。 經過長期觀察,atm 發現了穩定骰子的奧祕:有些數字的面貼着會互相排斥! 我們先來規範一下骰子:1 的對面是 4,2 的對面是
原创 KMP學習
July關於kmp的文章 Matrix67關於kmp的解釋 特別推薦Matrix67的博客,其中關於next數組部分原理講解的很簡單 可以使用的代碼 #include<iostream> #include<cstdio> #
原创 CodeForces 580C 樹+dfs搜索
Description Kefa decided to celebrate his first big salary by going to the restaurant. He lives by an unusual p
原创 POJ2362
挺簡單的搜索,只是當時沒能分析出題 注意剪枝優化 #include<iostream> #include<algorithm> using namespace std; int n,m; int s[22]; bool use
原创 HDU3760 Ideal Path 逆bfs+貪心
題目鏈接 題意 最短路徑 1–>n; 多條路徑情況下選擇路徑字典序最小的 解題 n–>1 bfs最短路 1–>n 滿足最短路的條件下找最小顏色 代碼 #include<iostream> #include<cstdio> #
原创 最短路徑--dijkstra
#include<queue> #include<map> #include<string> #include<iostream> #define INF 0x3f3f3f3f #define maxn 1010
原创 POJ2752 KMP中next數組的應用
這裏寫鏈接內容 #include <iostream> #include <cstdio> #include <cstring> using namespace std;