Hi,
Not sure if you managed to get AC till now or not but I too got TLE initially and here is my DP code which managed to get AC (the code is quite shabby :P Not following any variable naming or modularity conventions).
import java.io.IOException;
import java.util.Scanner;
public class Main ...
Search found 3 matches
- Fri Dec 09, 2011 7:33 am
- Forum: Volume 9 (900-999)
- Topic: 907 - Winterim Backpacking Trip
- Replies: 8
- Views: 12531
- Tue May 03, 2011 12:07 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320762
Re: 3+1 problem - runtime error
I figured out that the class name needs to be "Main" for the program to work.
Also, I removed DP since the integer array memo of 1Million elements could have been a potential source of problem.
But still, UVa gives me "Wrong Answer".
Please help.
My new code -
import java.io.*;
import java.util ...
Also, I removed DP since the integer array memo of 1Million elements could have been a potential source of problem.
But still, UVa gives me "Wrong Answer".
Please help.
My new code -
import java.io.*;
import java.util ...
- Tue May 03, 2011 5:43 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320762
3+1 problem - runtime error
Hi,
I have been trying to submit my code for problem 100 - 3n + 1 and though the code works well when I run it on my pc, UVa shows me a runtime error.
My code is as follows:-
import java.io.*;
import java.util.*;
class Problem100
{
static int memo[] = new int[1000000];
static int ans = 0 ...
I have been trying to submit my code for problem 100 - 3n + 1 and though the code works well when I run it on my pc, UVa shows me a runtime error.
My code is as follows:-
import java.io.*;
import java.util.*;
class Problem100
{
static int memo[] = new int[1000000];
static int ans = 0 ...