Two questions!

Hi Community,
Infact I have a question and a request. Please answer them!
(i) Please move the LOC June 2017 problems into the Practice Section. In my case, as I was to my village I could only solve 2 problems and had a solution prepared while on my trip for third problem. Now is there any way I can check whether my solution is correct or not?
Please check for my code if possible : Link

(ii) I have heard many a times about Offline and Online Algorithms (For e.g. Mo’s Algorithm is an offline algorithm etc.). I don’t know what does Offline and Online Algorithms actually mean. Please clear my doubt.

Thanks for the help :slight_smile:

In response to your questions:

1: Wait for a couple of days (or a week at max) and the problems of LOC June 2017 will be added to the practice section. Its the work of the @admin, the people here on discuss have no power to do that.

UPDATE 1: The problems are available now in the practice section.

2: An Online Algorithm takes the input and prints the calculated answer one by one. Whereas an Offline Algorithm need all the input data before it starts; Then, it manipulates the input and then prints the answer for all queries in one go.

The following thread nicely explains the difference between Online and Offline Algorithms.

https://stackoverflow.com/questions/11496013/what-is-the-difference-between-an-on-line-and-off-line-algorithm

2 Likes

Online algorithm means our algorithm answers the query as soon as it takes the input,but whereas in case of offline algorithm we store all the queries and we reorders them in order to decrease the number of operations and hence time complexity reduces.

THe Problem is already available in Practice section(in PEER)

Here is link to question : https://www.codechef.com/problems/KCHAR

Hey @dishant_18 , Here’s what you can do …Whenever a contest is over, And you want to submit any of its questions.
Just open the contest page and then click on the question u want to submit…
Then From the URL just remove the contest name…and hit enter. Bam you can now submit that question…!

For exzmple see this…

In the above URL, just remove LOCJUN17 and the new url becomes

1 Like

Thanks mate :slight_smile:

1 Like

It would be great if you could provide some corner test case for KCHAR (As I see you got 100 pts in that problem :stuck_out_tongue: ).

Thanks for the reply :slight_smile:

Well, if your logic is correct, then it would be correct on all cases as this problem does not have tricky test cases. But if you want to test your code for some big K’s then here are some.

Input:
3
35698784213499947
32648795651336669
10000000000000007

Output:
c
a
c

1 Like

Yup, I know that! But I think the problem wasn’t available by the time I asked the question!

Thanks for the help mate :slight_smile:

1 Like

Thank you :slight_smile: