Is 2nd sample output correct?I think it is wrong.
there n=6,x=3 and k=1.
so the ans will sum of 1,2,4,5,6 which is 18.
in sample output it is 15.
please tell me if I am wrong.
12751 - An Interesting Game
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 12751 - An Interesting Game
n=6,k=3 and x=1.
so the ans will sum of 4,5,6 which is 15.
so the ans will sum of 4,5,6 which is 15.
Check input and AC output for thousands of problems on uDebug!
Re: 12751 - An Interesting Game
so what actually that line means?
and what about the 1st output?At first move, Jodu will select K consecutive marbles (X, X + 1, X + 2, . . . , X + K ? 1)
starting from X and will remove them
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 12751 - An Interesting Game
The problem statement and sample I/O are correct. I can't explain that line any better than it already is written.
n=5,k=2 and x=2.
so the ans will sum of 1,4,5 which is 10.
n=5,k=2 and x=2.
so the ans will sum of 1,4,5 which is 10.
Check input and AC output for thousands of problems on uDebug!
Re: 12751 - An Interesting Game
so the statement said k numbers starting from x.
sorry I understood wrong...
anyway I got AC as you told..
![:wink:](./images/smilies/icon_wink.gif)
sorry I understood wrong...
anyway I got AC as you told..
![:wink:](./images/smilies/icon_wink.gif)
![:wink:](./images/smilies/icon_wink.gif)
![:wink:](./images/smilies/icon_wink.gif)