trie

1/3ページ

Let the Balloon Rise hdu1004 字典樹

Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is gues […]

Flying to the Mars hdu1800 trie

Problem Description In the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to find more land for the newborns […]

Phone List hdu1671 trie

Problem Description Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the p […]

Hat’s Words hdu1247 trie

Description A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find all the h […]

bzoj4896 [Thu Summer Camp2016]補退選 字典樹 vector

Description X是T大的一名老師，每年他都要教授許多學生基礎的C 知識。在T大，每個學生在每學期的開學前都需要選課，每 次選課一共分為三個階段：預選，正選，補退選；其中”補退選”階段最忙碌。在補退選階段，學生即可以選課，也 可以退課。對於X老師來說，在補退選階段可能發生以下兩種事件： 1: […]

bzoj3689 異或之 字典樹 堆

Description 給定n個非負整數A[1], A[2], ……, A[n]。 對於每對(i, j)滿足1 <= i < j <= n，得到一個新的數A[i] xor A[j]，這樣共有n*(n-1)/2個新的數。求這些數（不包含A[i]）中前k小的數。 注：xor對應於pas […]

cf430(div.2)D Vitya and Strange Lesson 字典樹

Description Today at the lesson Vitya learned a very interesting function — mex. Mex of a sequence of numbers is the minimum non-negative number that […]

【GDOI2018模擬9.21】數列

Description Input Output Sample Input 5 5 0 3 1 2 9 4 1 5 4 4 1 4 1 3 2 5 Sample Output 3 4 15 11 3 Solution 這題坑死我了 設輸入的陣列為a[] 一個區間l,r異或，相當於將異或字首後（即將a […]

[BZOJ2741][[FOTILE模擬賽]][可持久化Trie 分塊]

[BZOJ2741][[FOTILE模擬賽]][可持久化Trie 分塊] 題目大意： FOTILE得到了一個長為NN的序列AA，為了拯救地球，他希望知道某些區間內的最大的連續XORXOR和。 即對於一個詢問，你需要求出Max(Ai⊕Ai 1⊕Ai 2…⊕Aj)Max(A_i \oplus […]