ALEXROSE has judged wrongly?

Hello srd091,please fail my code…

Hello srd091,please let me know where it is failing

Hello srd091 ,can i wait for you response or not please let me know

Hello bansal1232,if you have the time and willing to test where it is failing please let me know the test case
Regards
Samuel

@jawa2code

I ran your code on hackerrank compiler (cause idk why codechef still gave me errors. Worked on hackerrank tho) and what I saw was-

For inputs <= 10^9, code worked all fine.

But when I entered 10^10 -

Runtime error
Input (stdin)
1
8 2
10000000000 25 25 30 30 30 30 25
Your Output
~ no response on stdout ~
Error
Exception in thread "main" java.lang.NumberFormatException: For input string: "10000000000"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:583)
	at java.lang.Integer.parseInt(Integer.java:615)
	at Main.main(Main.java:26)

I will say that take some time off this problem, and solve some other. Because the key points of problem sometimes strike randomly. Don’t stress over it dear!

@jawa

 Compilation Successful
Input (stdin)
1
6 3
50 1 40 2 50 40
Your Output
4

Expected output -

Group roses like 40,40,50 & 50,1,2.

Number of roses to be cut is 3. Your code gives 4.

@vijju123 The answer for the first test case is indeed 3, please check your answer before posting it on discuss forum.

1 Like

@jawa2code Its very unlikely that in codechef’s official contests test case are wrong so it’s much better to validate your code on different test cases before arguing and blaming someone.

2 Likes

Corrected :slight_smile: . Got confused regarding output asking for value of cut or just roses needing to be cut.

Email codechef regarding it. i don’t think they will publish editorials for DEC-16 challenge now.

@jawa2code for test case


1
6 3
1 2 3 4 4 5

you program is giving 4 while the correct answer is 3.

Exactly! Posting a code like that doesn’t seem to be good. Even the solutions of all programmers has been out then he can take a estimation about why and where his code is failing.

See if someone could not debug their own code then how can he/she survive in industry where he/she deals with such a large amount of codes.

1 Like

@bansal1232 - I think you misunderstood where I meant “A programmer wouldn’t be able to understand HIS OWN code if he sees it after a month” , perhaps I should had worded it better.

I simply meant to imply that, at least at this stage (where we are learning coding), we sometimes just…forget what we did or thought while solving the question XD.

I am sorry if it sounds confusing. I just wanted to imply that comments or telling approach is appreciated when requesting others to check your code. :slight_smile: (thanks for pointing out the ambiguity of my statement tho!)

Already talked to Rudreh,they told that soon they publish,alredy 2week over

oh please stop spamming the discussion session. If he is not replying then may be the reason is that he is busy in other stuff and have not seen that message. So i request you to be please be patience.

is it just me or that code just doesn’t compile on codechef ide…I tried removing blank space and stuff. It says " > expected" in each of-
TreeMap<String, Integer> table = new TreeMap<String, Integer>();
HashMap<Integer, Integer> reqCntTable = new HashMap<Integer, Integer>();

take code from “CodeChef: Practical coding for everyone

1 Like

Thank you vijju123
but for first sub tasks

Subtask #1 (5 points) 1 ≤ T ≤ 10, 2 ≤ N ≤ 12, 1 ≤ Ai ≤ 50

it should work
Regards
Samuel

Thanks a lot vijju123

np dear :slight_smile: