原创 Keen On Everything But Triangle HDU6601 主席樹

Keen On Everything But Triangle Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) T

原创 CodeForces 538F A Heap of Heaps 主席樹

Andrew skipped lessons on the subject 'Algorithms and Data Structures' for the entire term. When he came to the final t

原创 Super Mario HDU - 4417 主席樹/線段樹離線處理

Mario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor prin

原创 LCIS HDU - 3308 線段樹區間合併

Given n integers.  You have two operations:  U A B: replace the Ath number by B. (index counting from 0)  Q A B: output

原创 Hotel POJ - 3667 線段樹區間合併

The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny sh

原创 Sign on Fence CodeForces - 484E 可持久化線段樹區間合併+二分

Bizon the Champion has recently finished painting his wood fence. The fence consists of a sequence of n panels of 1 met

原创 Physical Education Lessons CodeForces - 915E 線段樹+離散化

This year Alex has finished school, and now he is a first-year student of Berland State University. For him it was a to

原创 牛客 A-Laptop 線段樹

題目描述 FST是一名可憐的小朋友,他很強,但是經常fst,所以rating一直低迷。 但是重點在於,他非常適合ACM!並在最近的區域賽中獲得了不錯的成績。 拿到獎金後FST決定買一臺新筆記本,但是FST發現,在價格能承受的範圍內,筆記本

原创 Mayor's posters POJ - 2528 線段樹+離散化

The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing th

原创 Infinite Inversions CodeForces - 540E 線段樹+離散化

There is an infinite sequence consisting of all positive integers in the increasing order: p = {1, 2, 3, ...}. We perfo

原创 A - Ultra-QuickSort POJ - 2299 線段樹

Description In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of

原创 博弈論與SG函數

引例:有n堆石子,每次可以從第1堆石子裏取1顆、2顆或3顆,可以從第2堆石子裏取奇數顆,可以從第3堆及以後石子裏取任意顆,問你必勝策略。這種變形的nim博弈感覺並不容易,如何去找必勝策略呢?往下看 什麼是公平組合遊戲? 公平組合遊戲:Im

原创 浙江省省賽部分題解

  E - Sequence in the Pocket   DreamGrid has just found an integer sequence  in his right pocket. As DreamGrid is bored

原创 Neko does Maths CodeForces - 1152C

Neko loves divisors. During the latest number theory lesson, he got an interesting exercise from his math teacher. Neko

原创 最大流之Dinic

網絡流基本概念 什麼是網絡流 在一個有向圖上選擇一個源點,一個匯點,每一條邊上都有一個流量上限(稱爲容量),即經過這條邊的流量不能超過這個上界。同時,除源點和匯點外,所有點的入流和出流都相等,而源點只有流出的流,匯點只有匯入的流。這樣的圖