WA WA!! I have read almost the entire forum, but still, I can't get AC. I have tested so many test cases but it's still WA... please help! I have no idea what is wrong now!! :(
import java.io.*;
import java.util.*;
public class Main{
static int row = 0;
static int col = 0;
static char ...
Search found 8 matches
- Tue Jul 28, 2009 8:34 am
- Forum: Volume 102 (10200-10299)
- Topic: 10267 - Graphical Editor
- Replies: 190
- Views: 77696
- Sun Apr 26, 2009 1:02 pm
- Forum: Volume 3 (300-399)
- Topic: 362 - 18,000 Seconds Remaining
- Replies: 75
- Views: 39018
362 - time limit exceeded... pls help...
I really don't know how to optimize the code more than this... I got time limit exceeded.. :( .. please help...!!
import java.util.*;
import java.io.*;
public class Main{
public static void main(String[] args){
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in ...
import java.util.*;
import java.io.*;
public class Main{
public static void main(String[] args){
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in ...
- Fri Apr 24, 2009 11:11 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320039
Re: 100 - Wrong Answer!! Please help!!
oops... sorry.. my clumsy mistake... i submitted the wrong code... now it's correct already.. hehe.. thanks a lot for your help! very appreciate it! Here is the final version of my code...
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public ...
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public ...
- Thu Apr 23, 2009 11:25 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320039
Re: 100 - Wrong Answer!! Please help!!
I have changed my code based on what you suggested but i still got back time limit exceeded.. :( .. i'm stuck now.. please help!!
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main{
public static int cycle_length(int num){
int ...
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main{
public static int cycle_length(int num){
int ...
- Thu Apr 16, 2009 6:48 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320039
Re: 100 - Wrong Answer!! Please help!!
This is my new version of the code and i got back Time Limit Exceeded...
import java.util.Scanner;
public class Main{
public static long cycle_length(long num){
long count = 1;
while (num != 1){
if (num%2 == 0){
num = num / 2;
}
else{
num = num * 3 + 1;
}
count++;
}
return ...
import java.util.Scanner;
public class Main{
public static long cycle_length(long num){
long count = 1;
while (num != 1){
if (num%2 == 0){
num = num / 2;
}
else{
num = num * 3 + 1;
}
count++;
}
return ...
- Thu Apr 16, 2009 12:06 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320039
100 - Wrong Answer!! Please help!!
I got back Wrong Answer.. I'm not sure if it is that my code is wrong or there is sth wrong with java submission. Totally have no idea! :(
import java.util.Scanner;
public class Main{
public static long cycle_length(long num){
long count = 1;
while (num != 1){
if (num%2 == 0){
num ...
import java.util.Scanner;
public class Main{
public static long cycle_length(long num){
long count = 1;
while (num != 1){
if (num%2 == 0){
num ...
- Mon Mar 16, 2009 5:06 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320039
Is it java problem?? Help pls!
I'm a newbie here.. I have tried 2 questions, the 3n+1 problem and Minesweeper problem. I'm not sure whether my code is wrong or it is java problem, but I always get Runtime Error from the judge. I've looked through the code so many times but I still can't find the reason. Help me pls...!
100 - 3n ...
100 - 3n ...
- Sun Mar 15, 2009 9:49 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320039
Re: 100
I don't know why but i got response as Runtime error.. here is my code...
import java.util.Scanner;
class Problem161{
public static long cycle_length(long num){
long count = 1;
while (num != 1){
if (num%2 == 0){
num = num / 2;
}
else{
num = num * 3 + 1;
}
count++;
}
return ...
import java.util.Scanner;
class Problem161{
public static long cycle_length(long num){
long count = 1;
while (num != 1){
if (num%2 == 0){
num = num / 2;
}
else{
num = num * 3 + 1;
}
count++;
}
return ...