"I want to ask a question" - Ask them all here!

The problems are moved to practice section. To easily get to the practice version of problem-

1)Click on weblink 2)remove the part “/MAY17” 3) HIT enter.

Regarding editorials, forum users cannot comment anything. Try mailing codechef about it, or try to ask the question as doubt here, we will surely help!

No, there is no way of viewing the test cases.

That helped. So, there won’t be any editorials?

Depends…only @admin can provide any information on it, and its advised to mail them for this. However, i case you need an editorial urgently, one of the discuss members would love to write one. Just ask once :slight_smile:

@ram_mahidhar

Here is the link where you can find the algorithms brother.

Please give the link to question also. I will then convert it to a question.

if a is a string, dont use a[i] = ch. Use a= a+ch; This will have the desired effect.

Sir,thank you for replying,but why should we not use it like that?

Insertion sort is O(N^2) in worst case and can cause TLE depending on input.

Well. I feel it can cause run time error due to “out of index” thing. We used this method in C, but there C was an array of char (length pre defined).

Here, we dont know length if string but we are making changes at i th index. Remember that string also gives out of index error just like array (eg - if arr[n+5] gives runtime error, then so will s[n+5]. Faced these issues during contests.

Treating it similar to array, i think you will get an error. But s=s+ch is different. It says “whatever be s, add ch to its end” , so theres no scope of going out of index here.

ok thanks.

You have 3 karma now, you can ask your own individual question. (Meaning you dont need to depend on this thread anymore)

Answer to sysm: The sub sequence doesn’t have to be continuous, but the order of elements should be maintained.
Input

1
5
1 2 3 4 5
3
1 3 5

Your Output:

No

Correct Output:

Yes

my C


[1]


  [1]: https://www.codechef.com/viewsolution/9684982

Haaaaaa. Thanks for your answer !

thank you very much sir,i will change it.

1 Like

Even i have the exact same query XD

Can you please check once the test cases provided by fellow members to other people who got WA? Have a look at similar questions and the errors, and then comment here if help is still needed. I will then convert it to a question (This question is being repeatedly asked, hence my request to have a check :slight_smile: )

You dont need this thread to ask question, you have enough karma to create one on your own. Just asking for confirmation- You want this answer to be converted into an independent question?

Stars are awarded on basis of your ratings. More ratings=more stars= meaning the user did well in contests

If the Q dont come within 24 hours, i will upgrade it into a question :slight_smile: