原创 [Java網絡編程] TCP協議實現聊天室

功能 水了一發控制檯上的聊天室,能夠發送公共消息和私密消息,效果如下    思路 用戶端初始時,首先輸入將要在聊天室中顯示的用戶名,然後創建與服務器的 TCP 連接,新建兩個線程用以發送與接收消息。在發送線程初始化時,將剛剛輸入的用戶

原创 [POJ2559] Largest Rectangle in a Histogram(單調棧)

傳送門:Largest Rectangle in a Histogram 題意 給定一系列高爲 hi,寬爲 1 的矩形,找出這些矩形組成的圖形中最大的矩形面積。 思路 要求最大的矩形面積,我們只要知道以每個矩形的高度向右最遠能夠延申到的寬

原创 Windows下MySQL修改密碼

打開命令行中,輸入 mysqladmin -u 用戶名 -p舊密碼 password 新密碼 例如:mysqladmin -u root -p123456 password 654321 其中,-p與舊密碼之間不能有空格

原创 [HDU1853] Cyclic Tour(拆點 + KM)

 傳送門:Cyclic Tour 題意 在 n 個點、m 條有向邊的圖中,找到使得每個點屬於且僅屬於一個環的若干個環,求環的邊權和的最小值。 思路 一個環如 1→2→3→1,若將每個點拆成兩個(如 1 拆爲 1 與 1’)就會變成 1→2

原创 [The Preliminary Contest for ICPC Asia Xuzhou 2019 - 徐州網絡賽G] Colorful String

Colorful String The value of a string ss is equal to the number of different letters which appear in this string. Your

原创 [The Preliminary Contest for ICPC Asia Xuzhou 2019 - 徐州網絡賽E] XKC's basketball team

XKC's basketball team XKC , the captain of the basketball team , is directing a train of nn team members. He makes all

原创 [The Preliminary Contest for ICPC Asia Xuzhou 2019 - 徐州網絡賽K] Center

Center You are given a point set with nn points on the 2D-plane, your task is to find the smallest number of points yo

原创 [The Preliminary Contest for ICPC Asia Xuzhou 2019 - 徐州網絡賽B] so easy

 so easy There are nn points in an array with index from 11 to nn, and there are two operations to those points. 1: 1

原创 [The Preliminary Contest for ICPC Asia Xuzhou 2019 - 徐州網絡賽I] query

query Given a permutation pp of length nn, you are asked to answer mm queries, each query can be represented as a pair

原创 [The Preliminary Contest for ICPC Asia Xuzhou 2019 - 徐州網絡賽C] Buy Watermelon

Buy Watermelon The hot summer came so quickly that Xiaoming and Xiaohong decided to buy a big and sweet watermelon. Bu

原创 [The Preliminary Contest for ICPC Asia Xuzhou 2019 - 徐州網絡賽D] Carneginon

Carneginon Carneginon was a chic bard. But when he was young, he was frivolous and had joined many gangs. Recently, Ca

原创 [HDU4300] Clairewd’s message(字符串哈希 / 擴展 KMP)

傳送門:Clairewd’s message 題意 給定一個密文的轉換表,即 26 個字母原文與密文的映射。然後,給定一個字符串,由密文與明文混合而成,其中前半部分爲密文,後半部分爲明文,明文可能有缺失(可能缺失全部),但密文一定爲完整的

原创 [HNUOJ1145] Isomorphic Inversion(字符串哈希)

傳送門:Isomorphic Inversion #include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define INF 0x3f

原创 [HDU5248] 序列變換

傳送門:序列變換 二分答案。如果一個數加上當前代價後仍然小於前一個數減去當前代價,那麼該值不可行,二分找到最小值。 #include <bits/stdc++.h> #define ll long long #define INF 0x

原创 [HDU5247] 找連續數

傳送門:找連續數 一個區間中的數連續,那麼這個區間的最大值減去最小值等於區間長度-1。 #include <bits/stdc++.h> #define ll long long #define INF 0x3f3f3f3f using