31 exam simulation summary

xinde31
finished this on the school, oi and cultural studies, two out really shi, Alice out a steadily study hall every day, look back to the room 30 minutes, 10 minutes decadence, then the class was over. . . A full five days to complete this change T3, low efficiency,
and consequently will not cultural studies, especially physical, confused, dazed
fifth day and the first day of mentality is completely different
, however, passed, no more , and successfully entered the semi-training,
attitude adjustment next write
T1

According to the data can be found in all divisible by gcd should be able to last a few, in fact, be regarded as conditions exgcd solvability of a promotion

T2

dp think well, consider optimizing transfer

Can get rid of absolute value to something, there are four cases, respectively, to maintain a variable fj + x + y, fj-x + y ...

T3 [monotone stack] [heuristic merge]

Each stack processing monotonous the maximum value point as the maintenance interval, can be found, which constitutes a binary tree,

ans1: For maintenance interval x f [x] [j] represent the binary bit lower j is the number 1, then every time I can put into a range of around two, small enumeration period, to see enumerations this is an exclusive-oR value of this number of times in the other sections, the contribution is $ 2 ^ j * num (f [other] [j]) $

ans2: Each point 01Trie maintain a tree, the same enumeration that little section in each number, look for another one in the Trie, the condition is satisfied to see how many there are, and put into the small of large , and then directly inherited like x

The time complexity of O (nlognlogv).

Guess you like

Origin www.cnblogs.com/casun547/p/11437244.html