highonjuice's blog

By highonjuice, history, 3 years ago, In English

Practice makes perfect, and cyan feels better than green. (Skip to the end if you don't wanna hear an interesting story)

A while ago, I made a post about almost being specialist. After a month of getting stuck on pupil, I was starting to think I was not fit to advance in my competitive programming journey. Doubts fell like droplets on a rainy day...

But I still practiced... Day after day I would do my daily dose of problems, learning cool new algorithms along the way. Maybe DSU? BFS? DP? Probabilities? Every day I was equipping my toolbelt for the journey. Every day I would challenge myself to a slightly harder task. Although I had to admit, in the back of my head, I was wondering when I will ever use these Data Structures and Algorithms.

Then the day came. In today's contest (Round #736 Div1+Div2), I briskly solved A (as I usually do) and took my time on B. (it was implementation, so it was a little annoying). Then I met C.

C was an interesting graph problem. I was thinking, dfs and brute force, but I saw that N was up to 1e5 so it wasn't possible. Then I found some crucial observations. I realized every update only changes the answer by 1. Then I found that I could make the problem a directed graph. More observations followed. Soon, I simplified from an O(n^2) algorithm that involved simulation to an easy greedy O(n) solution. Oh man. I loved it.

Then I found D, D was interesting. A twist from problem A. After a bit of doodling and writing testcases, I found myself using RMQs (or sparse tables). I barely cared for RMQs, and thought I would never need them, but the algorithm needed an O(1) GCD query, so maybe just maybe it was right. And it was.

After the contest I realized I was top 700, I was so happy. It was worth it in the end. Challenge yourself, and high ratings will come.

If you are stuck in pupil or newbie, the most common reason is you aren't challenging yourself. Do harder problems and most of all, have fun with it. It's going to be a long ride, so might as well enjoy it.

If you are better than me and have a higher rating, I hope you smiled at this blog post, and watch out, because I may even pass you soon.

As always, Happy Coding!!

Also my tags aren't going to be bad, I'll just put #contest or something generic, so it's not instagram-like

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

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

May I ask which problem you recommend to do? 1700, 1800? or maybe 2000 up?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Do problems 100-300 points above your level. You are 1270, so maybe do problems from 1300-1600 problems. Maybe 1700 for fun.

»
3 years ago, # |
  Vote: I like it +2 Vote: I do not like it

Congrats

»
3 years ago, # |
  Vote: I like it +17 Vote: I do not like it

Congratulate!

Challenging yourself is the correct attitude to Compitive Programing, but it was hard to insist. Weeks ago, I was an Candidate Master, but I back to Expert now, I think I should challenging myself more, and practice more, just like you.

Happy Coding! Hope both of us can insist challenging ourselves and be more powerful in CP!

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Any tips for beginners?

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    CF Visualizer

    For you specifically, do more problems around the 1000-1300 level, those are typical B problems. If you can do those, you will be fine. If you don't understand the solution, read the editorial and try to understand how you can improve next time. Look up some youtube videos if you don't understand.

»
3 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Congratulations!

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

This is so inspiring!

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Hey congrats Highonjuice on becoming cyan,can u give tips/guide by looking at my profile how to improve further more.

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    You did great on today's contest, so I'd suggest learning new data structs and algos, and practice, practice, practice. Also utilize different websites like atcoder and SPOJ for more variety.

    One more tip...practice on your speed, problem B took a while for you during R #736, so practice on speed as well. (Atcoder is a great place to start)

    I've actually never done a contest on Atcoder because I have to wake up at 7 am in my time zone, but maybe I'll do one soon.

    you will definitely be pupil real soon, too bad the next contest is a full week away

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Congratulation. Consistency and hard work are the keys. You are inspired me a lot.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

May I ask you if would you recommend me to do questions of 1800 1900 2000 ratings and how did you practice for advanced data structures of range queries?

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I think 1800 and above is incredibly hard. I think being only 300 above your current rating should be good enough. Many times, I would not be able to solve 1500 problems even though I've been practicing 1800 and above.

    Also, I practiced RMQs and other algos and data structs through https://cp-algorithms.com/. It's a great website and lists some cool algos to learn. I try to just pick out random ones and read the articles for fun. If I don't understand it. I guarantee there is a great video online from cool youtubers like SecondThread, galen_colin, Errichto and Geothermal who can explain this stuff 10x better than me.

    You aren't going to get these algos in every contest, but learn them because one day, you will encounter them. (tools in a toolbelt)

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Also my tags aren't going to be bad, I'll just put #contest or something generic, so it's not instagram-like

I'm really glad to see that you took my comment so well (and really surprised that you even remember it at all). Congratulations on reaching specialist, and good luck to you!

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    lmao, I actually thought it was true, my post really did seem to belong on Instagram lol. It was pretty funny, and it's just a memorable joke.

»
3 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

[deleted]

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Any Suggestion for me, I'm stuck at Newbie.

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it +1 Vote: I do not like it

    3 things:

    1. Never give up, a lot of the times I was like "this problem is out of my level," but sometimes you may be surprised

    2. Make observations and talk it out. Solving a problem is all about finding key observations and using different algos to solve it.

    3. try learning a new algorithm every day. The more you learn the more tools you have in your toolbelt. (the higher chance you can solve a problem)

    I think u can easily break out, but you just gotta get out of ur comfort zone. I believe in you ;)

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Can you tell me why am I still a newbie even after solving 3 problems from div2 codeforces round(123 rating increase)

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    First of all, gj. Solving C was pretty tricky for me, and some of my specialist friends couldn't solve it.

    However you were slow. Speed is really important. If I solved my problems much faster, I would be top 50. Here's the deal, you took 26 min on problem A, and 1 hour and 4 min on B, and 2 hours and 15 on C. Not only will you have more time to solve later problems, but being faster also feels good too. Don't worry, practice will just speed you up anyways.

    Also, make a template, add some common functions like binary search or something, they can speed up the process by a bit. (find youtube videos if you don't know where to start)

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    tbh you will reach pupil soon if you keep solving problems like C continously.

»
3 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Congrats bro !

hope to see you in better and higher rating :)

»
3 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Hello! I have only recently started Competitive Programming seriously. I saw you say that it is important to solve problems beyond your difficulty. I have two questions.

  1. How does one improve speed and accuracy? As we know most Div 2A, B and C are very easy but people still take time and get WAs. Wouldn't it make sense to practice 'some' easier problems of your level and try and ace them as fast/accurately as possible?

  2. When solving tougher problems, it is very likely that you may not be able to solve them, and thus will end up looking at the hints/solution approach/code. If I do that, does that still count as a solve? Because technically, I didn't solve it. Also how long until I actually look at the solution?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it
    1. Sure, you can solve easier problems for fun (I do too), but speed and accuracy for easier problems comes naturally with getting better at solving harder problems.

    2. Whether you "solved" it or not is a matter of semantics, but still implement it for practice. How long until you look at the solution depends, but at your level, the recommendation is that you should start looking at the solution after 20-30 minutes of being stuck (i.e. out of ideas).

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thanks a lot! What level of problems would you suggest I should be doing right now? I have only given two contests but I was able to solve Div2 A, B, C of the previous one.

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Your performance in your last contest was ~1400, so I would initially recommend to try problems rated 1400-1700. Note that your performance in one contest can vary, so if you find them too easy/too hard, adjust accordingly.

»
3 years ago, # |
  Vote: I like it +34 Vote: I do not like it

today was the day I got higher rating than majk

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +17 Vote: I do not like it

    I should organise a round to fix that.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +13 Vote: I do not like it

      plot twist: I sleep through it again

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

What was your thought process for D, did you end up solving primarily by writing some testcases down or did you do some mathematical manipulations with the modulo formulas?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I noticed at first that if I subtract the minimum from every number, I could check through GCD whether they could have the same modulo (if they had a gcd>1 that means they have a factor that could lead to the original number with the correct mod). I followed and constructed an RMQ (Gcd) and performed a binary search to find the answer. Wrong answer. Then I asked, "what if I take the differences of adjacent numbers?" And it worked.

    I write more test cases than formulas. Although I think formulas make your solution more concrete, test cases are usually faster for me. I dunno, either one is good.

    For more details to the solution, check this video by MagentaCobra. He's great at explaining stuff and I like his vids. https://www.youtube.com/watch?v=nD7Y7v1iWJ8

»
3 years ago, # |
Rev. 2   Vote: I like it +2 Vote: I do not like it
high ratings will come
  • »
    »
    3 years ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    Very appropriate profile picture for your current situation, I hope you rise soon to purple.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    you still can return back, i hope :D goodluck

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Good going keep it up... something similar happens to me too :)

»
3 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Wholesome Post <3

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Should i need to learn advance data structure (like segment tree) or just solve problems above my rating .

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Same Questions :_:

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Doing both is always better than doing one thing, but keep this in mind that data structure/advance technique related problems normally come up in later problems of Div2, primarily, D, E, F. For A, B, C, you just need to make the right observation and that is it, so if you struggle with A, B, C, learning advanced DS may not be in your best interest, but I guess you can overkill certain "easy" problems using one.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I agree with Bungmint, learn and do harder problems at the same time.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

"It's going to be a long ride" This statement hit me hard. Thanks for motivating me and others !!!

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I think you meant Cyan not Blue!

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by highonjuice (previous revision, new revision, compare).

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there are O(1) GCD query in cp-algorithms ?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    No, but there is the RMQ page.

    And in the case of problem B , we could modify the structure shown there because the functions (GCD and MIN) work similarly, i.e Min(a,Min(a,b)) = Min(a,b) | GCD(a,GCD(a,b)) (and that allows you to merge overlapping segments to solve in O(1), something that couldnt be done with operations such as addition, multiplication, etc.)

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Congrats!

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

ORZZZ!!! Congratulations

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

highonjuice, who am I to judge, but don't you think it was a little too early to write an inspirational blog and give advices in the comments?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    You said, who am I to judge, and then you judged. ;;

  • »
    »
    3 years ago, # ^ |
    Rev. 9   Vote: I like it +3 Vote: I do not like it

    lmao, I was just really happy when I became specialist. I'll keep making blogs because I think it's fun. it's ur choice to read then. I made a leap of faith towards specialist, and although I'm not cyan rn, I'm sure I can make it back soon.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      I was just really happy when I became specialist... I'm sure I can make it back soon

      When you do, please write another blog. Codeforces needs every documentation of that asap.