[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4758: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4759: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
Dev Skill Forum • View topic - Easy Coding Contest 6 - Editorial

Easy Coding Contest 6 - Editorial

All contest related discussion goes here. Both Dev Skill and Non Dev Skill contest related discussion is allowed. (But please keep the forum clean)

Easy Coding Contest 6 - Editorial

by devskill » Tue Nov 15, 2016 6:13 pm

User avatar
Site Admin
 
Posts: 118
Joined: Tue Feb 02, 2016 10:24 pm

Re: Easy Coding Contest 6 - Editorial

by jalal » Tue Nov 15, 2016 7:00 pm



This is a very easy problem. Most probably this was the easiest problem in the contest and got most solve.

This problem is based on a basic physics equation from high school physics. Formula for deceleration can be easily found in internet or in physics book. The only tricky part is the final velocity of the car will be zero as the problem statement says, the car will completely halt. If you know the formula and if you are able to process input/output, then there is nothing else that will stop you from solving it.
User avatar
 
Posts: 1
Joined: Tue Nov 15, 2016 6:18 pm

Re: Easy Coding Contest 6 - Editorial

by showmic » Wed Nov 16, 2016 10:08 am



In this problem if you observe all the term you will get a relation between them. There is actually 4 term given in the problem 3 is in the main question and one is in the sample input/output. So it is actually pretty much easy to find the sequence after observing those four term.
 
Posts: 3
Joined: Wed Nov 16, 2016 9:59 am

Re: Easy Coding Contest 6 - Editorial

by froghramar » Wed Nov 16, 2016 3:20 pm



If you have already solved some problems based on dynamic programming, you should not find it hard to solve this problem.

Can you write a recursive function to check if a sub-string of a string is palindrome or not? I hope you can. My solution is very similar to a recursive palindrome checker. What do you do in a palindrome checker? If you find a match in both sides of your sub-string S[l, r] you can reduce your problem to S[l + 1, r - 1]. Otherwise, you can say that the sub-string is not palindrome.

Now, you are not asked to answer if the given string is palindrome or not.

Let's define dp[l][r] as the minimum number of characters to add to make the sub-string S[l, r] a palindrome. Now you can solve your problem with two simple transactions.

1. If S[l] and S[r] are equal, you can not get a better solution than considering S[l] and S[r] as reflexive characters of your new palindromic string, as you are not having any cost of adding a new character.

Example, Result("ahbfhba") = Result("hbfhb");

So, dp[l][r] = dp[l + 1][r - 1], if S[l] = S[r].

2. If S[l] and S[r] are not equal, then you have no other option than adding an extra character in one of the sides to have a match. Let say, your current string is dfghdc. If you want to have a match in both sides, you can make it dfghdcd or cdfghdc.

Result("dfghdc") = 1 + Minimum ( Result("fghdc"), Result("dfghd") ).

So, dp[l][r] = 1 + Minimum (dp[l + 1][r], dp[l][r - 1]), if S[l] != S[r].
User avatar
 
Posts: 33
Joined: Thu Jul 28, 2016 8:14 am
Location: Amar Ekushey Hall, University of Dhaka

Re: Easy Coding Contest 6 - Editorial

by showmic » Thu Nov 17, 2016 11:41 am



In this problem there will be given N the number of student. In the next N line there will be two input one string and one floating point number.

Now for storing those number we can use structure consist of string and double. Like :

struct myStruct{

string name;
double cgpa;
};

Now we have to sort those data according to the question. But be careful about the merit position in the time of printing the output as two or more person can have same merit position.
 
Posts: 3
Joined: Wed Nov 16, 2016 9:59 am

Easy Coding Contest 6 Editorial

by lAnohizE » Fri Jun 16, 2017 2:46 am

Ive used that idea too, but I think people get lost in it when theres no visual.

Pressure = brightness seems harder to get than depth = brightness...as they can visualize depth and not pressure.

I wanted to explain lumens vs lux more than how to get throw vs flood per se...with an easy way to visualize what each is about.
 
Posts: 2
Joined: Thu Jun 15, 2017 12:35 am
Location: Broornnerne

Бижутерия своими руками

by lAnohizE » Tue Oct 22, 2019 9:43 pm

 
Posts: 2
Joined: Thu Jun 15, 2017 12:35 am
Location: Broornnerne


Who is online
Users browsing this forum: No registered users and 1 guest
cron