dorasainath955's blog

By dorasainath955, history, 7 weeks ago, In English

Submission
C1. Adjust The Presentation (Easy Version)

Approach: Assume that answer is "YA" and try to contradict it, if contradicted print "TIDAK"


  1. create a unique vector that consists of elements of "b" in such a way that no two consecutive elements are repeating
    b = {1, 1, 2, 2, 3} unqiue = {1, 2, 3}
  2. create a map mp that stores whether a element element has already occured(useful to verify if the slide encountered, bi can be given by person with same as bi).
    eg: b = {1, 2, 2, 1}, a = {1, 2, 3}, since person-1 and person-2 can give slide-1, 2. Then again we encountered slide-1 at b[3](zero index) so person-1(he's visited it) can be rearranged into giving slide-1 at b[3], map stores this information
    • Iterate through all elements of unique if the index i goes out of bounds for array a then break the loop;
    • if you find a[i] != b[i] && mp[unique[i]]==false then we can't arrange the persons in array to get our element bi print "TIDAK"

Full text and comments »

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

By dorasainath955, history, 7 weeks ago, In English

Submission this is the problem I'm trying to solve, my approach is to create a map that consists of each element and their frequency count, then for intial MEX i try to find elements less than MEX and such that x%(mp[i]-MEX)==0 and mp[i]>1. i try to convert that repeating element into MEX, if i couldn't I'll break out and print the MEX as answer, else I'll repeat the process until i reach size of array n. Where am i going wrong?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By dorasainath955, history, 2 months ago, In English
  • Vote: I like it
  • 0
  • Vote: I do not like it

By dorasainath955, history, 7 months ago, In English
  • Vote: I like it
  • 0
  • Vote: I do not like it

By dorasainath955, history, 8 months ago, In English

problem link: Problem

Submission Link : Submission

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it