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

Any picture/screenshot you can give?

They have fixed it.

Thanx for ur help!!

Have a look at my solution in case you are trying in c++

i have checked your solution but i am not able to understand?? plz jz explain in simple few words!!

What I did was, first I sorted trainers w.r.t. day of coming. Then, inside the loop, for each trainer who arrives at day=i, I add them to the queue. The queue sorts all the trainers (who came today and before) on basis of sadness.
Trainer at top has most sadness. We take, and remove the top element.

Now, we know the total sadness when no one takes lecture. We let trainer at top take lecture, and remove the count from total. If trainer has more lectures remaining, we add him again to the queue. This way, we greedily choose the trainer who takes lecture at a given day, and has arrived.

Please use this thread only if you have 1 karma or less.

Only for challenge problem. Also, in challenge problem, your solution runs agaisnt all (to ascertain your AC doesnt change to WA or TLE after contest during rejudge)- just that score is calculated using few selected ones instead of whole.

Pretest-Systest concept is not yet followed at codechef.

Here-

 Input
1
abcdefghijklmnnooppqqrrssttuuvvwwxxyyzzzza
Your Output
14
Expected Output
I think 26 because all alphabets are present.

abcdefghijklmn this the greatest substring that could be obtained which has all distinct characters! after that some letter repeat. how come 26? i am interpreting the question wrong way?

got it!! Uh i mistook the question…and here i spent almost 2 hours running behind this! all it needed was set() method thats it! just 2 lines of code (in python)

sorry, and thank you

Yup. Subsequence need not be continuous. Take it as “subset” :slight_smile:

Hmm. Thats a tough question with 0 discussions and no editorial. Bump your old question as well. Perhaps some more experienced guy could help, that thing went all over my head :frowning:

check this

ur even value is not correct for

4 4 4 1

E

I like the idea of segregating it-like 100% attendance in long gives X laddus, in cook off gives Y laddus and in lunchtime gives Z laddus.

The only thing I will have to discuss is, if they are feasible with it. I will forward your suggestion :slight_smile:

thanks a lot

please check for any errors in the below code for PERMPAL question also and clarify.

https://www.codechef.com/viewsolution/17351891

I think your query is answered :smiley:

I think this question is more suitable at stackoverflow.com than here.

Also how you add code snippets to an answer properly ? I tried copy pasting it but it was poorly formatted. Also the link posted is wrong, the correct link i CodeChef: Practical coding for everyone

Fixed link- just give space b/w brackets. There is a button in editor called “Enter code”. Just paste code, select it and press that button.