Search found 13 matches

by ggll
Sat Aug 30, 2003 10:19 am
Forum: Java
Topic: JAVA-Difficulties We Face
Replies: 31
Views: 30066

My expericence is that the output speed is the single hugest disadvantage. Most other difficulties can be overcome, easily or not quite easily. There have been 10+ problems so far that I couldn't solve in Java because of the output speed. In most cases, the results are ready in less than 2 seconds, ...
by ggll
Tue Aug 12, 2003 11:59 am
Forum: Volume 1 (100-199)
Topic: 109 - SCUD Busters
Replies: 96
Views: 35650

Most likely you got an exception in this part. You can use "try catch" to verify this.
by ggll
Tue Aug 12, 2003 11:22 am
Forum: Java
Topic: Anyone has success with inner classes in Java submission?
Replies: 3
Views: 2690

Your method works! Thanks!
by ggll
Wed Jul 16, 2003 10:25 am
Forum: Java
Topic: Anyone has success with inner classes in Java submission?
Replies: 3
Views: 2690

Anyone has success with inner classes in Java submission?

It sounds like inner classes can be used in Java submission, but I always got compile error whenever I used them(and the code compiled perfectly on my local machine).

Has anyone successfully submitted Java code with inner classes? If so, could you please give a outline on how you did that? Thanks.
by ggll
Sat Jul 12, 2003 1:30 am
Forum: Volume 101 (10100-10199)
Topic: 10137 - The Trip
Replies: 159
Views: 65936

The variable count will always be 0, can you see why?

Most likely there is also a double precision issue. Try adding an EPS to the int cast.

Looks like these two bugs together get you passed the test cases above.
by ggll
Sat Jun 28, 2003 8:01 am
Forum: Volume 102 (10200-10299)
Topic: 10291 - Cut the Legs
Replies: 3
Views: 2943

10291: cut the legs - lousy input format

Just FYI. While the problem states that For each table, a line will give an integer t, between 3 and 50, indicating the number of legs on the table. t subsequent lines will give, in order around the table's circumference, the lengths of the legs in millimeters. it doesn't mean that each line only ha...
by ggll
Fri Jun 27, 2003 2:33 pm
Forum: Volume 104 (10400-10499)
Topic: 10460 - Find the Permuted String
Replies: 8
Views: 20076

Just wanna point out that the input of this problem contains blank lines. This is DISGUSTING considering the problem statement. Now you know why if you are so sure about your program but still keep getting WA.
by ggll
Tue Jun 10, 2003 10:45 pm
Forum: Volume 101 (10100-10199)
Topic: 10137 - The Trip
Replies: 159
Views: 65936

Good to know that it finally works for you. Actually I was doing it the other way around. I used int everywhere. It is always safer to work with integers. Now you mentioned it, I managed to get your original version passed with one modification(and the '=' of course). [cpp] for (x=0; x<num; x++) { d...
by ggll
Tue Jun 10, 2003 9:18 pm
Forum: Volume 101 (10100-10199)
Topic: 10137 - The Trip
Replies: 159
Views: 65936

The algorithm itself is fine. I just got AC with it. The problem must be in the I/O part. I am not quite familiar with c++ so I am not sure here. You do need to put a '0' there for less than 1 dollar. Try long long data type.
by ggll
Tue Jun 10, 2003 8:06 pm
Forum: Volume 101 (10100-10199)
Topic: 10137 - The Trip
Replies: 159
Views: 65936

Actually I mean {0.01, 0.03, 0.03}, i.e. a case in which round = true and all element above average = total + 1. If your current version looks like this, it should be fine. I tried this(not exactly the same) and passed. Please post the new version if there are still problems. [cpp] for (x=0; x<vecF....
by ggll
Tue Jun 10, 2003 6:48 am
Forum: Volume 101 (10100-10199)
Topic: 10137 - The Trip
Replies: 159
Views: 65936

I think {1, 3, 3} will break your program. Looks like you put negative amount in the pile sometimes. Other than that it looks fine.
by ggll
Tue Jun 10, 2003 6:10 am
Forum: Volume 101 (10100-10199)
Topic: 10137 - The Trip
Replies: 159
Views: 65936

Basically, given the total cost and the 'within one cent' rule, you know what the final cost distribution should be. To minimize the exchange, try to choose the cost closer to the actual cost. However, this is not always possible, so choose high if start high, choose low if start low....
by ggll
Tue Jun 10, 2003 5:35 am
Forum: Volume 101 (10100-10199)
Topic: 10170 - The Hotel with Infinite Rooms
Replies: 20
Views: 12177

10170

About problem #10170, I tried both binary search and direct attack as shown below. However, the binary search method got WA, while direct attack passed. I generated > 20 million random test cases(using the limitation in the problem) and always got the same result. Any idea what might be wrong? Anybo...

Go to advanced search