You are not logged in. Please login at to post your questions!


Announcement for IOPC 2017

Hello all,

Techkriti 2017 presents International Open Programing Contest (IOPC) with huge prize money of INR1,20,000 at stake. We have tried to make the contest utilize the best of your time. This is an individual contest of 3 hrs to start on 21 April 2017. The contest will be rated. Contest page :

Hoping for a huge response from everyone. The best may prevail over.

Regards Software Corner Techkriti 2017

asked 19 Apr, 23:43

dpraveen's gravatar image

4★dpraveen ♦♦
accept rate: 20%

edited 19 Apr, 23:45

But techkriti was in march.

(20 Apr, 06:33) mathecodician5★

Answer is hidden as author is suspended. Click here to view.

answered 20 Apr, 12:11

marshal_roxx's gravatar image

accept rate: 2%

I really loved problem D - "Christmas Time" ... first read and immediately start to work on it; until I see that other two problems have been solved very fast... so one stop, problems solved, and again almost two and half hours stucked with problem D (I know, I know, this is a very common mistake in programming competitions: read all the problems, and never, I mean never fall in love with only one --- this is a good advice for newbies)... I´m frustrated because I was not able to find some enough fast solution to solve the problem at the end.

Would be some editorial for this problems? I´m wondering if there is any kind of dynamic solution which run notable faster than N^2 for problem D... Looking on internet we can find a lot of Math´s conjectures and formulations about "partitions of integer numbers", which at any point you could use to solve one part of the problem due it´s equivalent to find the number of ways to distribute N gifts. But I can´t find any formula which works properly although they find numbers which are very close to correct answers; it´s seems that kind of math´s are not a good idea for this problem :)

Now I reviewed all problems and apart of this, it was a good contest with nice tasks. Thanks beforehand for any answer.


answered 21 Apr, 20:12

ymondelo20's gravatar image

accept rate: 5%

Exactly what I recommend people. Take out 15 min and read all problem before attempting.

(21 Apr, 20:14) vijju1233★

Just trying one point of this good article "Teamwork in Programming Contests: 3 * 1 = 4 :" ... not trying teamwork obviously, it was more about solving some harder problems firstly and then the easy ones, considering 3 hours of contest at the end you are more tired to try harder problems.

(21 Apr, 20:30) ymondelo204★
Answer is hidden as author is suspended. Click here to view.

answered 19 Apr, 23:58

rohit_jere_rj's gravatar image

accept rate: 15%

The contest announcement says "Techkranti" instead of "Techkriti" :P

Techkranti - IOPC 2017


answered 21 Apr, 14:30

drajingo's gravatar image

accept rate: 37%

May be a typo!

(21 Apr, 14:33) rohit_jere_rj3★

I am participating in the competition right now. each submission is taking at least 5 minutes to give a verdict. Really frustrating! Sad to see this happening in a rated round :(


answered 21 Apr, 15:58

tanmay_garg95's gravatar image

accept rate: 0%

edited 21 Apr, 15:59

Submissions in python are taking over 10 mins. Agree with @tanmay_garg95. Really frustrating.


answered 21 Apr, 16:00

mathecodician's gravatar image

accept rate: 8%

Yes, it was really frustrating. Submit a solution, get result after 15min that its a TLE. At the first instance, I was like " the judge WAITING for my program to finish? (and since time increases exponentially, what about algos requiring 10^6 seconds? :p )

(21 Apr, 20:15) vijju1233★

@mathecodician Can you share your approach for problem Birthday and tears?

(21 Apr, 20:17) siddharthp5383★

Is not a hard problem... for sure it was the second easy one... some idea:

1 - Read the numbers, store them in some array.

2 - Linearly compute for each position how many numbers starting on it are equals (and consecutive), not matter if you do that to the right or to the left.

3 - Use a recursive solution for cutting the original string and so on, and keeping always with the minimum amount needed.

(21 Apr, 20:49) ymondelo204★


//Initialize some variable "best" with a huge number. Note that "last" is an array and it store for each position, the position of last element to the right which is equal to it; they form a consecutive row of equal values...

Call a Recursive Function: COMPUTE(1,large_of_string,0)

void COMPUTE(int ini, int fin, int c) {

if(c >= best) return;

if(last[ini] >= fin) best = c;

if(0 == (fin - ini + 1) % 2) //Even length...


COMPUTE(ini + (fin - ini + 1)/2, fin, c+1);

COMPUTE(ini, fin - (fin - ini + 1)/2, c+1);



(21 Apr, 20:52) ymondelo204★

I didn't use recursion.I first checked whether the given string is the type of string chef likes.If it's of that type print 0.I then checked parity of the length of the given string if it's odd print -1.Then even length strings comes into consideration.Here we have 2 cases.If given string is power of 2.If it is then I started with temp= n checked whether it can be the answer or not.Then temp=n/2,n/4..Down to 2.Final ans if log2(n) - log2(temp).If it's not power of 2 then here we have only one case.If after tearing the middle part(we get two strings),just checked if any of them is ans.

(21 Apr, 21:21) siddharthp5383★

What's wrong in above approach?

(21 Apr, 21:21) siddharthp5383★

Thanks for your idea @ymondelo20

(21 Apr, 21:22) siddharthp5383★
showing 5 of 7 show all

Someone upvote me ...


answered 21 Apr, 19:23

wanna_risk's gravatar image

accept rate: 0%

thanks for organising it .


answered 20 Apr, 14:18

abhi_shakes's gravatar image

accept rate: 33%

Answer is hidden as author is suspended. Click here to view.

answered 21 Apr, 20:31

marshal_roxx's gravatar image

accept rate: 2%

Answer is hidden as author is suspended. Click here to view.

answered 20 Apr, 01:52

ardentcoder's gravatar image

accept rate: 15%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol



Asked: 19 Apr, 23:43

Seen: 514 times

Last updated: 21 Apr, 21:22