Skip to main content

Alexey Tarasevich

Alexey Tarasevich's Public Library

about 13 hours ago

=base solution=
go from end
when find a zero - rotate from actual to target zero position

it moves non-zero elements several times

each should be moved once

zeros are indistinguishable
-> can be swapped
-> can be counted / compressed

=model representation=
prefix a[0...out] - output stream
suffix a[in...len] - input stream

=triz insight=
input memory = изделие
extra memory = tool

about 15 hours ago

This solution has several interesting steps

=model for representation=

which model can we use for the representation (array of ints)?
. multi-set
. sequence
. function
. oriented graph

OG is most specific model matching the statement. all but one node have <= 1 incoming nodes. one have >= 2 incoming nodes.

=special object=

there is another special object in the representation.
vertex n-1 don't have incoming nodes.
so it's not a part of a loop.
so if we follow the chain starting at it, we will arrive to the node we are looking for.

Aug 14, 16

i missed the fact
that h is "affected" not just by minimal element of suffix,
but also by the size of the suffix:
h(s)=min(min(s), size(s))

. binary search allows us to find easily shortest (e.i. yielding greatest h) S | min(s) >= size(s)
. but we need S relating to greatest h:
.. min(s) >= size(s)
.. or size(s) >min(prev_s)

  • locating a substring if a certain number of mistakes are allowed
  • locating a substring in

  • многие изобретатели, губят свою жизнь на то, что они решают ненужную задачу, они решают, а она не востребована потом
  • что нужно рынку, затем нужно выбрать правильный объект для совершенствования, в нем нужно найти правильную задачу и потом эффективно её решить
Aug 12, 16

=sub-problem analysis=

==whole problem==
. structure: state0 -> 0, 1 or 2 followers
. sub-result representation: prefix as an array (common, optimal)
. sub-problem representation: suffix as an index
. grouping: by sub-result
. compare and cut: by sub-result increment
. tail: we don't need previous states

==ranges tree map==
. structure: state0 -> 0, 1 or 2 followers
. tail: we combine sub-problem results
. sub-result: not represented
. sub-problem representation: node in the tree
. pre-processing: tree
. grouping: -
. compare and cut:
.. non-intersection of query and node -> null
.. query covers node -> node.sub-result


understand: greedy: we can skip/"waste" as many digits as needed to find the next best
(greedy = short sighted)

the first solution approach was wrong:
- i overlooked the case when from both input numbers we choose the same biggest number
- for that i was always choosing the first
- actually both should have been considered as solution candidates

. each result prefix can be achieved in several ways
. but if we have two branches we can easily compare them
. each state (sub-problem) is (input suffix 1, input suffix 2, result prefix)
. how to choose the next state?
. which order and structure to choose?
. from end: 
.. to get the next state we need the appropriate resources
.. need a structure that finds leftmost biggest element for a segment
. inertia:
.. i was thinking of approach (pqueue from previous approach) instead of a function (find leftmost biggest digit on the segment)
.. i noticed that
.. clearly stated sub-problem

good: understood i need:
. cut off bad sub-problems: inferior result prefixes
. identify state: input suffixes + result prefix
. find a state with compact representation
.. suffix - just index
.. result prefix - common (the optimal) for all sub-problems
. identify advancing axis: sub-results
. stick to the right approach
. identify problem: step implementation
. consider simplified task:
.. single input sequence instead of two
.. n1 + n2 = k

=it's a breadth-first=
. maintain a set of sub-solutions + sub-problem
. build a set of "paths"
. cut if possible
. optimization task
. there are several edges (exits) from the state

ideal representation (of sub-state): 0(1)

  • Абстрактной «уверенности в себе» я лично предпочитаю «готовность к риску»
  • быть рядом со своей неуверенностью, выдерживать ее – и действовать так, как хочешь
  • люди боятся не новизны или риска как таковых, а поражения, вероятность которого возрастает вместе с новизной

7 more annotations...

Aug 11, 16

validate connection
test: replace app* with wrong values
check: authenticate() throws exception

1 - 20 of 6070 Next › Last »
20 items/page

Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »

Join Diigo