white_square's blog

By white_square, history, 17 months ago, In English

Hey,

Hamming Code
Topological sorting
What if input contains 0 while bit manipulation..?
String at most 1 odd character

I hope you like squares!!

Please also share what you learned this week!!

white_square

Full text and comments »

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

By white_square, history, 18 months ago, In English

Hey,

I tried solving problem 96B - Lucky Numbers (easy) and it gave me very strange TLE.

My submission 207541848 got TLE at n=10^9, but the same code passes the same test cases on the codeforces custom test compiler with a time of 1300ms (approximated).

As the time limit is 2second, Why am i getting TLE on main test?

 main test tle picture

 Custom test time limit picture

Now the rest of the solution is right and fits under the time limit. I just made a special case with n=10^9 and passed the main test. 207553081

Please help me figuring out what's happening wrong.

Thank you

white_square

Full text and comments »

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

By white_square, history, 21 month(s) ago, In English

The original problem is : 1373D - Maximum Sum on Even Positions

My Approach

Now the approach was correct if we have to reverse only one subarray.

But what if, we can reverse a number of subarray, suppose K.

How would that be solved?

I came up with the following approach, is it correct?

Approach

Is my approach correct?

Please do share your approach too.

Thank you.

white_square

Full text and comments »

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

By white_square, history, 2 years ago, In English

Question:- 181B - Number of Triplets

Question

Solution that got accepted-: 178183074

Solution that got rejected-: 178183367

Other solution using same concept

Summary: The logic of both code is same, I've tried using HashMap and HashSet but the solution does not work.

I do not understand why don't the code using HasHmap/HashSet work.

Any help is appreciated.

Thank you.

Full text and comments »

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

By white_square, history, 3 years ago, In English
Background

After doing so much practice I am still not able to turn green, so I asked myself what I am doing wrong and so here is the list of answers I found.

I don't sit seriously for the contest for whole 2 hours, after just solving and apparently debugging the first question my mind gives up and I cannot think straight for the 2nd question. I try to concentrate and somehow after several wrong answers on pretest 2 and 3, I sometimes solve question 2. Now to become pupil either I should solve 2 questions fast or solve question 3, depending on the type of contest. I neither solve question 2 fast nor solve question 3. As a matter of fact I have never read question 3 in any contest(div2 +) , even after solving question 2. My rate of up solving questions is around 0.3(I up solve 3 contest out of 10).

The rating of questions I have solved average around 1000 across all websites. To pass pupil a knowledge of 1200+ rated question are required and I don't even solve them. Solving a large amount of questions feel good so I do that instead of solving questions that are of good quality.

I also lack in the department of consistency, after solving questions for 1 week the next week is just pure waste, and full of procrastination. The same cycle have been continuing for the past 8 months.

Last but not the least reason, I preferred writing this blog rather than solving questions.

Bye for now, now I go and try to work on the regions I lack.

Full text and comments »

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