You are viewing a single comment's thread. Return to all comments →
n = number of sequence lastAns=0 q = number of query sequences S0={} S1={} S2={} . . . Sn={}
for queries type (1) 1 x y index of sequence id = (x^lastAns)%n append y in Si-th sequence
(2) 2 x y index of sequence id = (x^lastAns)%n lastAns = valueAt(y%(size of Si-th sequence)) and pint lastAns
after every query value of lastAns will be updated according to query type.
Seems like cookies are disabled on this browser, please enable them to open this website
Dynamic Array
You are viewing a single comment's thread. Return to all comments →
n = number of sequence lastAns=0 q = number of query sequences S0={} S1={} S2={} . . . Sn={}
for queries type (1) 1 x y index of sequence id = (x^lastAns)%n append y in Si-th sequence
(2) 2 x y index of sequence id = (x^lastAns)%n lastAns = valueAt(y%(size of Si-th sequence)) and pint lastAns
after every query value of lastAns will be updated according to query type.