原创 Codeforces 853C(掃描線+樹狀數組)

Ilya is sitting in a waiting area of Metropolis airport and is bored of looking at time table that shows again and

原创 CodeForces - 514D (線段樹+二分)

An army of n droids is lined up in one row. Each droid is described by m integers a1, a2, …, am, where ai is the nu

原创 HDU-4417(可持續化線段樹or莫隊)

Problem Description Mario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our m

原创 HDU 4333(擴展KMP)

Problem Description One day Silence is interested in revolving the digits of a positive integer. In the revolving o

原创 UVA - 11019(AC自動機)

Given an N × M matrix, your task is to find the number of occurences of an X × Y pattern. Input The first line cont

原创 HDU 4300(擴展KMP)

Problem Description Clairewd is a member of FBI. After several years concealing in BUPT, she intercepted some impor

原创 luogu-p2292(AC自動機)

題目描述 標點符號的出現晚於文字的出現,所以以前的語言都是沒有標點的。現在你要處理的就是一段沒有標點的文章。 一段文章T是由若干小寫字母構成。一個單詞W也是由若干小寫字母構成。一個字典D是若干個單詞的集合。我們稱一段文章T在某個字

原创 POJ 2778(AC自動機+矩陣快速冪)

Description It’s well known that DNA Sequence is a sequence only contains A, C, T and G, and it’s very useful to an

原创 HDU 2222(AC自動機)

Problem Description In the modern time, Search engine came into the life of everybody like Google, Baidu, etc. Wisk

原创 HDU 3065(AC自動機)

Problem Description 小t非常感謝大家幫忙解決了他的上一個問題。然而病毒侵襲持續中。在小t的不懈努力下,他發現了網路中的“萬惡之源”。這是一個龐大的病毒網站,他有着好多好多的病毒,但是這個網站包含的病毒很奇怪,這

原创 luogu-P2899

題目描述 Farmer John has decided to give each of his cows a cell phone in hopes to encourage their social interaction.

原创 luogu-p1486(fhq treap)

題目描述 OIER 公司是一家大型專業化軟件公司,有着數以萬計的員工。作爲一名出納員,我的任務之一便是統計每位員工的工資。這本來是一份不錯的工作,但是令人鬱悶的是,我們的老闆反覆無常,經常調整員工的工資。如果他心情好,就可能把每位

原创 HDU-6534 (莫隊算法+樹狀數組)

Problem Description Chika gives you an integer sequence a1,a2,…,an and m tasks. For each task, you need to answer t

原创 HDU-2196(樹形DP)

Problem Description A school bought the first computer some time ago(so this computer’s id is 1). During the recent

原创 luogu-p1533

題目背景 小卡由於公務需要出差,將新家中的狗狗們託付給朋友嘉嘉,但是嘉嘉是一個很懶的人,他纔沒那麼多時間幫小卡喂狗狗。 題目描述 小卡家有N只狗,由於品種、年齡不同,每一隻狗都有一個不同的漂亮值。漂亮值與漂亮的程度成反比(漂亮值越