rb235's blog

By rb235, history, 3 years ago, In English

We has a N (N <= 10^5) position and 2 car on shaft number (from 0 to 10^9). Initially 2 cars in 2 positions different on the shaft number. Mission is each position in N position has been visited by only 1 in 2 car and visited by ordered 1, 2, 3, .. N. We have a lot of way. But we need find one way has max distance of car 1 and car 2 all time is minimum. Print minimum distance.

Input:

First line has N, pos of car 1, pos of car 2

Second line has N position

Example:

Inp
Out
Note

Thanks! <3

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it

By rb235, 3 years ago, In English

Some one can help me the this problem with T query. each query we have Val and Pos, we replace this Pos in array by Val then calc sum the count unique number in all sub new array. With array have 1e5 element, |val| <= 1e5, 1e5 query

Exmple

inp
out
Explain

Help me pls, thanks

Full text and comments »

  • Vote: I like it
  • -7
  • Vote: I do not like it

By rb235, history, 3 years ago, In English

Hi guy, I have this problem. We have a string <= 1e6 character and have the following transformation: each character of the string we can replace it with the preceding or following character in the alphabet and if it is 'a' or 'z' they can become 'z' or 'a'. and string only have character in alphabet. Each transformation we cost 1. Minimize transformation. Sorry because my English so bad.

Full text and comments »

  • Vote: I like it
  • -3
  • Vote: I do not like it