You are not logged in. Please login at www.codechef.com to post your questions!

×

# FEB19 HMAPPY2 Wrong Logic Gives AC (100/100) !!

 1 1.Wrong Logic Without LCM Still 100/100 !! 2.Right Logic With LCM 100/100 !! This Solution contains wrong logic still it gives 100/100 This Solution only gives perfect answer when they give input A & B as the LCM(A,B) is A or B only.else it's wrong u can check that. The Hidden test case files only contains that input in which LCM(A,B) is A or B.. so Test Cases are not considering all conditions.. Even The Example Test case is not in that test case file !! Because this solution gives wrong answer in that example test case also !!! still it gives AC(100/100) !!!! asked 13 Feb, 21:47 3★mj_13 15●3 accept rate: 0%

 0 Yeah it's observable 6 2 3 3 then 6/2=3 and 6/3=2 , lcm(2,3)=6 therefore 6/6=1 and 2*1=2 so final solution is 3+2-2=3 and 3>=3 hence 'Win' according to your logic:- 6/2=3 and 6/3=2 then |3-2|=1 and 1<3 hence it's 'Lose then this should be a wrong answer. answered 13 Feb, 22:17 3★mann2108 50●3 accept rate: 100%
 0 yeah you are right the hidden test cases only have LCM(a,b) == a or b that's why his solution worked I think that ideal solution should be after considering the LCM of a,b see these two solutions of mine : answered 13 Feb, 22:32 30●4 accept rate: 9%
 0 Seems like question has weak test cases. The accepted solution without LCM should be WA. answered 14 Feb, 02:21 5★vichitr 265●5 accept rate: 11%
 toggle preview community wiki:
Preview

### Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×189
×63
×11
×3

question asked: 13 Feb, 21:47

question was seen: 509 times

last updated: 14 Feb, 02:21