# [Community Puzzle] Logically reasonable inequalities

https://www.codingame.com/training/easy/logically-reasonable-inequalities

Created by @dhaunac,validated by @Randrian,@Djoums and @GenesisQ.
If you have any issues, feel free to ping them.

1 Like

need to ask because I passed all testcases and most validators but validators 3. can someone please show some hints about validators 3? I think I must lose some points which I never mention about.

1 Like

Iâ€™ve written you a private message.

1 Like

Same issue for me as Doniface. I can pass test 3 but not validator 3 (I am assuming they are related like usual); any hint would be much appreciated.

Validator 3 actually has more inequalities to deal with than test 3. Iâ€™ve sent you a pm.

2 Likes

Thanks. That explains a lot. Itâ€™s probably why I can pass the tests but not Validator 3 â€“ itâ€™s nearly twice as long as the longest test. So you can get through the tests with little optimization but thatâ€™d be impossible on the validator. My suggestion would be to add a test equally long.

Cannot pass validator 3 either, have no clue what the problem is, please explain that specific test case. Thanks.

I think there is no need to apply graphs and then e.g. BFS or DFS on them, because itâ€™s enough to use a single array.

Bonjour,

Je ne comprend pas pourquoi le test 3 est KO alors que le test 4 est OK.
Quelque chose mâ€™Ă©chappe et je ne trouve pas ce que câ€™estâ€¦

La sortie de mon test 3 :
l1 : L > Z consistent
l2 : Z > F contradiction
Test â†’ KO

La sortie de mon test 4 :
l1 : L > Z consistent
l2 : Z > F contradiction
Test â†’ OK

Merci,

Attention, on ne regarde pas lâ€™ordre alphabĂ©tique.

2 Likes

Hey, came here because I think that the tests are incomplete.
I think that you should add a system of inequalities in which we encounter 4 different variables in the first two inequalities :
Example :
A > B
C > D
E > D
B > C
So the users will really have to use a graph approach.
Thanks !
@dhaunac

1 Like

En fait jâ€™avais une condition qui arrĂŞtait mon algo Ă  la seconde ligne, dâ€™oĂą les debugs similaires sur les 2 premiĂ¨res lignes avec des rĂ©sultats attendus diffĂ©rentsâ€¦

Jâ€™ai vu le pb en commentant mon algo et en laissant le debug.

Hi,

If the output must be in contradiction then it is not enough.
Iâ€™ve pass your test with a simple algorithm (list + condition), so I dont think it is enough to force the use of graph.

1 Like

The expected output was `consistent`. Try with that :
A > B
C > D
D > F
E > F
B > E
F > A
(Expected output: `contradiction`)
@Kwaiiil

All test cases pass and 4/5 validators too, but fail on Validator 3! Can anyone explain my why???

The first few messages in this discussion mentions that Validator 3 is a much longer version of Test 3. More details for your reference:

• first 9 inequalities in Validator 3 is linear, just like the first 4 in Test 3.
• the remaining 9 inequalities in Validator 3 involves previously seen variable names and nothing new, just like the last inequality in Test 3.

I think this lacks longer testcases, e.g., A > B > C > D > E > F > G > H > J > A which is a contradiction, some solutions fail this due to 8 letters being greater than J. unless a proper algorithm is used, length will matter.

nice puzzle, thanks!

can i get clue for third validator ? i got best optimization as i know, even in wording, i think i included all context in my algorythmâ€¦ doesâ€™nt work.