TTUPLE - Editorial

my code worked for 90 pts but failed for 10 pts. it would be great if anyone could help me with the testcase that it failed. thanks… https://www.codechef.com/viewsolution/34300959

no some are 3 and some are 1 also according to me

Try these cases. They might help

22

-1 -15 9
6 -5 10

8 -6 3
9 -7 -8

1 5 9
-8 -9 5

-4 3 8
-8 -6 2

7 6 2
4 -5 6

4 5 8
4 -5 6

2 3 8
9 -1 0

41 8 2
1 -8 63

3 -5 7
6 -5 10

-8 6 3
9 -7 8

1 5 3
-2 3 4

1 -2 3
2 3 5

-1 2 9
4 -5 6

1 2 5
-4 5 6

6 -5 9
2 3 5

1 5 6
3 2 5

4 8 6
3 5 2

2 6 4
5 3 10

9 0 10
0 -4 4

3 -4 7
4 7 -4

-3 7 -8
8 3 0

-1 -15 9
6 -5 10

Output:

3
3
3
2
3
2
3
3
1
3
2
3
3
3
2
2
2
2
3
3
3
3


27
3 5 7
6 5 10
8 6 3
9 7 8
3 8 18
5 13 21
3 8 18
5 13 23
1 3 5
3 7 11
1 3 5
3 4 11
1 3 5
3 6 6
2 7 9
25 50 60
2 7 9
25 35 60
2 7 9
25 10 45
3 5 7
15 50 14
3 5 7
15 75 21
9 -2 -1
10 -3 1
1 5 7
7 27 37
3 5 7
4 10 15
2 3 4
6 10 13
2 3 4
5 9 11
3 4 5
15 30 35
3 5 7
10 7 14
3 5 7
13 10 14
3 5 7
12 10 14
-3 -3 -2
-2 2 3
-55 0 20
0 22 0
-3 5 1
5 -2 6
4 5 7
11 20 35
7 5 3
28 10 20
1 2 3
0 0 0

output:

1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1

9
0 -3 1
7 0 6

6 -5 -6
0 2 9

-3 0 -3
0 8 6

8 9 8
1 -9 0

1 4 -7
-2 0 -1

-4 -5 4
0 9 -7

-5 10 0
0 -1 6

-6 -10 -9
-1 9 0

1 5 7
11 27 37

Output:

3
3
3
3
3
3
3
3
3

2 Likes

Please pick an accepted solution and write a random test case generator, run the both solutions to figure out the correct and incorrect answers.
I have done the same and got some these results.


Please let me know if there is any error.

How do you check for these cases ?

a1 * x + y = b1
a2 * x = b2
a3 + y = b3

assuming this is possible for only one unique (x,y)
and also these kind of cases:

(a1 + x) * y = b1
(a2 + x) = b2
(a3 ) * y = b3

1 Like

I saw your solution I had similiar solution but there is a request… if possible could you please provide me a test case that is not covered in subtask 1 but covered in subtask 2…
If you had faced any problem in subtask 2, then please tell me about that edge case or test case.

Hate this question. I tried for more than 4 days and now I even don’t want to cross check which condition I left :sob: :sob: :sob: :sob:.

2 Likes

My Solution
Can someone give counter testcase? It passes the 2nd subtask but not the 1st…
@rajarshi_basu

Thanks a lot!

You were not crazy enough it took me 500 lines :joy: :joy:.
https://www.codechef.com/viewsolution/34351278

can u tell me why for (1 5 7 )and(11 27 37) the ans is 2 and not 3

June long challenge editorial beginner friendly video explanation with animation and code
Delicious cake (CONTAIN) : Codechef June Long Challenge||The Delicious Cake(CONTAIN) - YouTube
Tom and jerry (EOEO) : CodeChef June Long Challenge||The Tom and Jerry Game!||EOEO - YouTube
Even matrix (EVENM) : CodeChef June Long Challenge||Even Matrix|| EVENM - YouTube

1 Like

It’s answer is 3

The answer for this should be 3… but its 2 according to what you have posted

1 Like

yes my ans is also 3 but its given 2 in the post of keshav (in the 15 testcase of the 28 testcases given)

Well it’s Wrong , I checked with my sol. as well as DIV1 Rank 1 Sol. both gave 3.
If his algorithm is giving 2 then it’s wrong.

yes thats what i meant to say… and still i am unable to find error in my code and not able to find wrong testcase for 10 marks after testing above cases

In my case something was Wrong with XK1K2 part i edited this and was able to get 100 points.

@rajarshi_basu I loved the editorial style. It’s simple and to the point. But how did you detect these harder test cases because I personally really struggled, and in a lot of questions struggle, to find these types of test cases in CP. Can you tell your thinking process or approach to find these types of cases in a question?

3 Likes

No bro, I passed both the subtasks at the same time. I was having wrong answers before that at both of them. First i never thought that this problem was going to have so many cases that’s why i failed many times before getting AC and then i wrote all the possible combinations from the 7 subsets of (p, q, r) which would give me the answer in 2 operations since that was the hard part and i found which cases i was missing. May be you should try to write them as well and see which of them are missing from your solution.