FlyingElephant's blog

By FlyingElephant, history, 16 months ago, In English

I was solving this problem. But I keep getting RTE on test2 and I dont understand why.

My idea is selecting the smallest 2*n elements by putting them into a set. Then I use two pointers on the array sorted by coordinate component in order to get the system of nested segments. No wonder what goes wrong with that.

SUBMISSION

Full text and comments »

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

By FlyingElephant, history, 19 months ago, In English

Hi, currently I am practicing around difficulty 1500 in solved-by descending order. However I found out that older problems are like garbage. I mean, not garbage in the actual sense, but they are basically effortless when compared to modern 1500. Nowadays problems look way harder when compared to older ones. There are old 1500 which are comparable to modern 800, if not even easier. Is it good if I keep going this way solving anyway all the problems in solved-by descending order or maybe I would benefit more when solving only hard 1500 from modern contests? I think the difficult will naturally increase anyway after a while if I keep going solving in descending order and also there are chances I anyway meet some new concept to learn, which is always good. However, on the other side, there are chances I just lose my time solving too easy problems. What do u suggest?

Full text and comments »

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

By FlyingElephant, history, 19 months ago, In English

Hi, I looked at some contest dashboards and I noticed in some cases there are some plus sign in the row corresponding to a partecipant submission, while in some others there is the score corresponding to the problem solved. What is the difference between those two?

EDIT: I really don't understand downvotes. What's wrong with asking such a question?

Full text and comments »

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

By FlyingElephant, history, 19 months ago, In English

I was solving three block palindrome (easy version). I attempted a top down solution which gives correct results but it is giving TLE on 2nd test case. I wonder if it is there any chance to solve it by using this approach or the constraint given are too tight to even try this out...

I looked at somebody else submissions but they use the same approach as the one suggested in the editorial.

Maybe converting this code to bottom up there is a chance to get accepted? Any help/hints/suggestion is appreaccited.

The idea behind my approach is just recursively going from left to right and considering all the possible cases such that the first element to be filled will be the one labelled with value v1, the second with value v2, the third with value v3. Having one of those values = 0 means the block considered in this case is empty (ie no value has been chosen at all, thisallows to check for candidates such that there is only one element occurring in the whole subseq). Finally in case at the end the seq is not a palindrome I prune the solution returning INT_MIN.

Full text and comments »

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

By FlyingElephant, history, 20 months ago, In English

Hi, I was trying to solve this problem and I am having hard times getting an accepted solutions. I tried a standard 0/1 knapsack approach iterating on the quantities of each book but got TLE on 5/10 test cases. I made some research and found this blog on CF in which this solution was provided but I am not able to figure out neither why the loop over j stops at H[i] nor the inner loop over l. It seems a very complicated approach. Also I've found this other approach which seems way easier but even in this case I am not able to clarify in my mind what is going on. If anybody could explain me how this works will be very apprecciated. In particular if u could also provide me some useful easier/similar problem which uses similar concept would be amazing. my submission

Full text and comments »

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

By FlyingElephant, history, 20 months ago, In English

I can't figure out what is wrong with my submission: 198733749 Can anybody please help me in finding a counter-example for my solution?

Full text and comments »

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