Search found 4 matches

by kenshin_kudo
Sun Feb 23, 2003 2:49 am
Forum: Volume 1 (100-199)
Topic: 155 - All Squares
Replies: 11
Views: 2020

155 - All Squares

Does anybody know why I got compile error for this one? It worked on my machine... :-? [java] import java.io.*; import java.util.*; class Main { static String ReadLn (int maxLg) // utility function to read from stdin { byte lin[] = new byte [maxLg]; int lg = 0, car = -1; String line = ""; try { whil...
by kenshin_kudo
Mon Feb 17, 2003 6:30 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 53225

Um try this....instead of initializing min to some large number, try to use
-1 instead and make special case for the first occurence.
There might be a possibility that the number of movements is greater than your initialized min value.
by kenshin_kudo
Sat Feb 15, 2003 6:30 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 190660

Never mind.....

Oh well. I finally figured it out by my own..... Here's some pointers for those who are trying to solve this problem! If you are using java, make sure you see this points: Your class has to be called Main and it must not be public!!!! Your static class MUST be public! This is my bug. You cannot use ...
by kenshin_kudo
Fri Feb 14, 2003 7:01 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 190660

Problem 100 Java Wrong Answer?

Can anybody see what's wrong with this code? :( [java] //@BEGIN_OF_SOURCE_CODE // @JUDGE_ID: 28212NH 100 Java "Easy algorithm" import java.io.*; import java.util.*; class Main { static String readLine () // utility function to read from stdin { int maxLg=255; byte lin[] = new byte [maxLg]; int lg = ...

Go to advanced search