原创 CF R340

  A. Elephant time limit per test 1 second memory limit per test 256 megabytes input standard input output stan

原创 ACM羣賽(二)

鏈接: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=104400#overview Description Problem A: Parity Source fi

原创 ZOJ Paint the Grid Reloaded

Description Leo has a grid with N rows and M columns. All cells are painted with either black or white initially. Tw

原创 POJ1703 Find them, Catch them

Description The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs

原创 HDU A Simple Problem with Integers

Description Let A1, A2, ... , AN be N elements. You need to deal with two kinds of operations. One type of operation

原创 NOIP 2005 等價表達式(hash算法)

題目描述 Description 明明進了中學之後,學到了代數表達式。有一天,他碰到一個很麻煩的選擇題。這個題目的題幹中首先給出了一個代數表達式,然後列出了若干選項,每個選項也是一個代數表達式,題目的要求是判斷選項中哪些代數表達式

原创 區間衆數

一、塊狀數組 塊狀數組就是將數組劃分若干塊(一般爲sqrt(n)使複雜度最低),通過預處理i~j塊的答案(複雜度可以保證在n*sqrt(n)內), 求答案時就根據預處理的答案和暴力枚舉首尾多餘個數得出最後答案,首尾多餘的個數是不超過2*s

原创 線性規劃——單純型算法

一、線性規劃的標準化 (1)目標函數:max (2)約束條件:等式 (3)變量約束:非負xj >= 0 (4)資源限量:非負bj >= 0 二、非標準型的標準化(以下變量後面括號中均爲下標) (1)min轉換爲max min Z = CX

原创 BZOJ 2555: SubString

2555: SubString Time Limit: 30 Sec  Memory Limit: 512 MBSubmit: 2880  Solved: 861 [Submit][Status][Discuss] Descriptio

原创 關於map處理String的複雜度問題

map複雜度 關於map平時一般用得比較多,畢竟自己寫一個平衡二叉樹或者Treap還是較麻煩的,map一般複雜度爲logn,但是有時候發現用map竟然也超時,比如統計不同單詞個數(字符總個數不超過1000w),用map時就超時了,原因是C

原创 FFT(快速博立葉變換)

證明請參考算法概論的快速博立葉。 FFT遞歸: #include <bits/stdc++.h> using namespace std; const int maxn = 5005; const double PI = acos ( -

原创 文件頭

#include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <cmath> #include <cstdlib> #includ

原创 使用g++命令生成dll文件實現lua調用C代碼

首先安裝gcc環境,下載MinGW,MinGW只是一個管理工具,真正的環境還需要在裏面下載注意選中下載項後點擊菜單項中Installation--->Apply Changes纔會開始下載,會下載至MinGw安裝目錄下,確保bin目錄中存

原创 BC Round 74

LCP Array    Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) 問題描述 Pete

原创 ACM 羣賽

點此打開鏈接 A - 1 Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ