Please could you keep your debugging requests to a single thread? This (screenshot) is a bit much. If someone is able to help you debug your code, I'm sure they will. In the meantime, there are plenty of resources available: there is an editorial for that question, as well as a repository of correct solutions that have been submitted. I attach here my own: https://www.codechef.com/viewsolution/46032335
I suggest you generate some test cases, and run them against your code and against successful submissions to find discrepancies. Thanks [image: samuel.PNG] On Wednesday, June 2, 2021 at 11:24:57 AM UTC+1 jawa wrote: > Hello , please let me know for which test case it is falling > Solution: 46363012 | CodeChef > https://www.codechef.com/viewsolution/46363012 > My Algorithm:- > 1)Nodecount Map contains the number of nodes under this > 2)x_at_node it contains x value at each node > 3)once x_at_node table populated, suming all x’s mod of1000000007 > > On Sun, 25 Apr 2021, 20:56 Benzir Ahammed Shawon, <[email protected]> > wrote: > >> Can anyone please tell me what's wrong with this code? It's showing *RE *at >> the *Test Set 2*. >> >> import java.util.Scanner; >> import static java.lang.Math.max; >> >> public class Solution { >> public static void main(String[] args) { >> Scanner scan = new Scanner(System.in); >> int tt, n, i, index, ans = 0; >> int[] x = new int[100]; >> n = scan.nextInt(); >> for (tt = 1; tt <= n; tt++) { >> ans = 0; >> index = scan.nextInt(); >> for (int j = 1; j <= index; j++) { >> x[j] = scan.nextInt(); >> } >> for (int jj = 1; jj <= index; jj++) { >> int min = x[jj]; >> int maxn = x[jj]; >> while (maxn <= x[jj - 1]) { >> maxn = maxn * 10 + 9; >> min = min * 10 + 0; >> ans++; >> } >> x[jj] = max(x[jj - 1] + 1, min); >> } >> System.out.println("Case #" + tt + ": " + ans); >> } >> } >> } >> >> -- >> -- You received this message because you are subscribed to the Google >> Groups Code Jam group. To post to this group, send email to >> [email protected]. To unsubscribe from this group, send email to >> [email protected]. For more options, visit this group at >> https://groups.google.com/d/forum/google-code?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Google Code Jam" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/google-code/ad485df3-94ac-4c5d-a277-4fe3e503f657n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/google-code/ad485df3-94ac-4c5d-a277-4fe3e503f657n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- -- You received this message because you are subscribed to the Google Groups Code Jam group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at https://groups.google.com/d/forum/google-code?hl=en --- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/8515f2b9-7510-4bf6-aedd-725fc1615754n%40googlegroups.com.
