Shayan's blog

By Shayan, 21 month(s) ago, In English

2000A — Primary Task

Video

2000B — Seating in a Bus

Video

2000C — Numeric String Template

Video

2000D — Right Left Wrong

Video

2000E — Photoshoot for Gorillas

Video

2000F — Color Rows and Columns

Video

2000G — Call During the Journey

Video

2000H — Ksyusha and the Loaded Set

I initially solved this problem for a fixed value of k (by mistake), and then generalized it for varying values of k.

Video

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

| Write comment?
»
21 month(s) ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Only video Tutorial?

»
21 month(s) ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

how solutions with O(n*k*100*100) passes in F?

»
21 month(s) ago, hide # |
 
Vote: I like it +40 Vote: I do not like it

Alright, I'm just gonna say it. This video tutorial is not very good. No offence to Shayan but this is not very helpful for someone who is just getting started. Wish we had a text editorial as well.

  • »
    »
    21 month(s) ago, hide # ^ |
     
    Vote: I like it +2 Vote: I do not like it

    May i ask why you think it's not helpful? it's better for people to just focus on problems around your level, so it's common if you don't understand how to solve problems with rating above 1900 or 2000. Shayan did a great job on explaining the observation and the concept of problems which i think it's very helpful for beginner, not just about what algorithm/data structure we need to use.

  • »
    »
    21 month(s) ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    And we will always have text editorial, it's just not out yet

»
21 month(s) ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

I'm Chinese and I can't watch video on Youtube without VPN.

»
21 month(s) ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

thanks for the good work !

»
21 month(s) ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I participated in the contest and solved A,B,C, now it is my B and C are marked as red. Can anyone tell me why this happened?

  • »
    »
    21 month(s) ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    System testing is going on. Your solution will be again judged on new added test cases thats why they are marked red. wait for sometime they will be evaluated

»
21 month(s) ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I need help

Can anyone tell me why my solution in proplem E got TLE when i write it in java , but when i write the same code in c++ i got AC

java solution --> Your text to link here...

c++ solution --> Your text to link here...

»
21 month(s) ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

The video tutorial is good but I think the written editorial is the best.

»
21 month(s) ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

can someone explain the last eg of tc1 in problem F?

»
21 month(s) ago, hide # |
Rev. 3  
Vote: I like it +5 Vote: I do not like it

Solution

Approach: Stored the loads available in a map of int, set. Key is load, and the set stores the values just after which the available series of a particular load starts.

For query "?" just find the load greater than or equal to the this value in the map and print the first element of this set.

For query "+" find the values just greater and less than this value, this will give the available load and the value just before the start of series. Now remove this value from that set, and calculate two different loads and insert them into the respective keys of the map.

For query "-" find the values just greater and less than this value, this will give two available loads, remove from those and insert into the new load.

Please explain what is wrong in the implementation or logic.

  • »
    »
    21 month(s) ago, hide # ^ |
    Rev. 2  
    Vote: I like it +1 Vote: I do not like it

    I did the same logic and it fails in the following case:

    1
    6
    1 4 6 7 8 9
    1
    ? 1

    Answer is 2 but code give 5.

»
21 month(s) ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Could you please provide a solution tutorial in text? In computer classroom we are not allowed to play a video with sound, because it may disturb others.

»
21 month(s) ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Only vedio TUtorial?please NO!!!

»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

why does problem G have binary search tag?