Help

Pages: 123
@Dum i got 1st subtask but 2nd SubTask #Task 1 is failing . same as you
Last edited on
#Task 2 is failing for me.
@TheTimes dont post your code you may get plagarised
delete it or edit it asap
Last edited on
if you wana send code PM me don't post here
i think i found the mistake in your code.
Last edited on
Hey, I am relatively new to comp programming..
I have found the pattern by writing the test cases for n=2,3,4 etc. but I am not able to get AC. I am using a loop until we start getting all numbers consecutively. Can u suggest whats wrong with this approach? For the last two test cases its giving TLE!
Last edited on
@TheTimes I was also facing the issue with Task #1 . I was getting AC in all cases except the Task #1. Later I did some tweak in my code and I got 100 points
@abo what was your code's complexity?
i came out with the formula and so the time complexity was O(1) and got passed in 0.16 seconds.

Just find the values for n=3 and k={1,2,3,4,5,6,7}
Also find for n=4 and k={1,2,3,4,5,6,7}

You will see a pattern.
It will be an A.P.

You just have to find the first term, last term.
And then you can apply formula for sum of A.P series

Then you will surely get 100 Points
Last edited on
@abo, have you solved LENTMO ?
@abo I also have an issue in solving sub task 1. I don't understand what's wrong in my code. It gives correct output in my computer though. Someone plz suggest me what to do. Stuck here since two days
:( This is pretty frustrating now.
for all of you, who are getting AC in task#2 and WA in task#1,
if you guys are unable to find your mistake and dont wish to spend any more time in that question, you guys can just make brute solution for task#1 and split your code with if cases with respect to the constraints , thats the most simple thing you guys can do right now.
@kanken I have done some brute force thing for subtask, but not the complete solution for LENTMO
@aryastark715 for n=2 formula is k*(k-1)/2 and for n>2 you can find it urself easily
@abo can you tell how you applied %mod, I think I am not doing it right because task2 of subtask2 is giving WA!
@kanny44

you can apply the modular addition property if you are using it anywhere in your prog.
(A+B)%m = ((A%m)+(B%m))%m
if you are having problems with mod then this should definitely solve it.
Or u can PM me the code and I will sort the issue out
Last edited on
@abo, please check your pm.
Thanks
Topic archived. No new replies allowed.
Pages: 123