# DCP 114 - Triples [ Need Some Critical Tests ]

Dev Skill archived problems can be discussed here.

### DCP 114 - Triples [ Need Some Critical Tests ]

I Am getting Wrong Answer in this Problem.

Problem: http://devskill.com/CodingProblems/ViewProblem/114

Here is My Code: http://ideone.com/KHS8R6

I tried Several Cases... Like:

Code: Select all
`1052 4 6 8 1045 2 3 791 3 3 5 2 4 6 6 6101 3 3 3 5 2 4 6 6 650 1 1 2 060 0 1 1 2 051 1 2 2 361 1 2 2 3 450 0 0 0 060 1 0 1 0 2`

For those Cases I have the following outputs:

Code: Select all
`Case 1: 4Case 2: 2Case 3: 7Case 4: 7Case 5: 2Case 6: 3Case 7: 2Case 8: 4Case 9: 1Case 10: 3`

Are the outputs Correct ? If not then which one is incorrect? If correct then please give me some critical tests....

Posts: 4
Joined: Mon Oct 24, 2016 11:57 am
Location: Comilla University , Comilla

### Re: DCP 114 - Triples [ Need Some Critical Tests ]

First of all, I have seen a lot of submissions for this problem. I think most of the submissions are based on wrong solutions because I think most of the users have misinterpreted the problem statement. A triple {p, q, r} comprises of the indices p, q, and r where p ≠ q ≠ r and (1 ≤ p, q, r ≤ N). The problem asks for the number of distinct triples of indices, not elements. And also {p, q, r}, {p, r, q}, {q, r, p} etc. are considered as same triple because only the order of p, q, r changed, not their values. Two triples will be distinct only when there will be at least one member which will be in one triple but not in the other. For example {3, 8, 9}, {9, 3, 8}, {3, 9, 8} etc. are same triples whereas {3, 8, 9 } and {8, 9, 10} are not.

After going through your code, it is clear that you have misinterpreted the description. Please go through the description again, then try to find what approach may lead you to pass your code within the time limit. Happy coding!

Posts: 3
Joined: Wed Oct 26, 2016 12:50 am

### Re: DCP 114 - Triples [ Need Some Critical Tests ]

You should Clear it in the Statement using some example or Notes below ( as the CF does )

Posts: 4
Joined: Mon Oct 24, 2016 11:57 am
Location: Comilla University , Comilla

### Re: DCP 114 - Triples [ Need Some Critical Tests ]

The problem itself has clear statement which doesn't need this much clarification.

Posts: 3
Joined: Wed Oct 26, 2016 12:50 am

Who is online
Users browsing this forum: No registered users and 1 guest