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

geeksforgeeks.org is best website for this. Also, there are tutorials on codechef, and many answers which deal with how to start coding/learn algorithms. Give forum a search (cant provide link atm, any other user who can is requested to provide link)

I can’t reply to ram_mahidhar directly, but here’s a good book for beginners:

https://cses.fi/book.html

PLEASE NOTE-

ANY QUESTION RELATED TO ON-GOING CONTEST WILL BE STRICTLY DELETED.

Please note- Inactive questions etc. will be removed after 24 hours of inactivity. Users are requested to tell if their query is answered or if there is still need to convert comment to Q .It will help us in managing this thread.

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: )