# why W/A DCP-33: Catch Me If You Can

Dev Skill archived problems can be discussed here.

### why W/A DCP-33: Catch Me If You Can

removed after accepted....
Last edited by joy25896 on Sun Apr 02, 2017 2:44 am, edited 1 time in total.

Posts: 30
Joined: Wed Nov 16, 2016 3:29 pm

### Re: why W/A DCP-33: Catch Me If You Can

First, if d is 0, then v1 and v2 have no role; only T will determine result.

Second, Abir will survive if sum>=sum1, not sum>sum1.

Code: Select all
`for(int i=1;i<t;i++){    sum1+=v1;    sum2+=v2;}`

you could have written,
Code: Select all
`sum1 = v1*t;sum2 = v2*t;`

Fourth, have you checked this?
Lets
• search through previous topics before posting a new topic
• include link to problem (or at least problem number)
• write code snippets inside [code] [ /code] tags

Posts: 48
Joined: Thu Nov 24, 2016 9:11 pm

### Re: why W/A DCP-33: Catch Me If You Can

Removed after accepted....
Last edited by joy25896 on Sun Apr 02, 2017 2:43 am, edited 1 time in total.

Posts: 30
Joined: Wed Nov 16, 2016 3:29 pm

### Re: why W/A DCP-33: Catch Me If You Can

Try this I/O:

Input:
Code: Select all
`42 1 0 02 1 0 11 2 0 01 2 0 1`

Expected output:
Code: Select all
`Case 1: Abir will surviveCase 2: Abir will be arrestedCase 3: Abir will surviveCase 4: Abir will be arrested`

Code: Select all
`Case 1: Abir will surviveCase 2: Abir will be arrestedCase 3: Abir will surviveCase 4: Abir will survive`

Reason:
First, if d is 0, then v1 and v2 have no role; only T will determine result.

Solution:
Remove v1==v2 && from your code.

Let us know if there is any more problem.
Lets
• search through previous topics before posting a new topic
• include link to problem (or at least problem number)
• write code snippets inside [code] [ /code] tags

Posts: 48
Joined: Thu Nov 24, 2016 9:11 pm