Search found 23 matches

by slxst
Sat Oct 13, 2007 7:01 am
Forum: Java
Topic: Some things you have to know about Java Support.
Replies: 2
Views: 3619

Scanner have method .hasNext...() for every .next...() so you can not only check for EOF but also to changes in the input (from numbers to strings for example)

But as far as I know, online-judge doesn't likes Scanner so you can't use it.
by slxst
Sat Oct 13, 2007 6:57 am
Forum: C++
Topic: Always WA, even with correct output... (what am I missing?)
Replies: 6
Views: 3663

More importantly, no there is no "presentation error" so every problem outputting the correct solutions will get a WA which may be confusing. Always check that there is exactly 1 newline character after the end of output. Another easily-to-overlook mistake is to print an empty character after printi...
by slxst
Sat Oct 13, 2007 6:22 am
Forum: Volume 103 (10300-10399)
Topic: 10364 - Square
Replies: 47
Views: 15100

I'm also trying to use backtracking but I got TLE. This is my reasoning: Check if you have already found a solution If not, check if you have already use all elements of the vector If not, cycle over the elements that haven't been used check if the element plus an accumulated total is exactly the le...
by slxst
Sun Aug 26, 2007 2:39 am
Forum: Other words
Topic: Outside Problem - Ball Bearings
Replies: 0
Views: 1663

Outside Problem - Ball Bearings

I was looking to Ball Bearings ( I tried the obvious: calculate the inner circumference and divide by the number of balls plus the space required: int howMany(double D, double d, double s) { return (jnt)( ( 3.141592653589793*(D-d) )/(d+s) ); } Which ...
by slxst
Mon Jul 23, 2007 11:11 pm
Forum: Volume 112 (11200-11299)
Topic: 11215 - How Many Numbers?
Replies: 11
Views: 4989

rujialiu wrote:I'm not sure I understand your algorithm correct. Will it try something like (1+1)*(1+1)?
Yeah it will. An so it will test:



and all possible combinations, it's just a backtracking of all the possible cases but it seems horribly slow!
by slxst
Sat Jul 21, 2007 5:26 pm
Forum: Java
Topic: Problem submitting Java
Replies: 1
Views: 2905

Problem submitting Java

I'm having a lot of frustrating problems submitting code in Java. First I tried to use Scanner but it complained. I tried BufferedReader and it complained too. I adjust the sample problem solution and it didn't complain but started complaining on BigInteger. I read the boards but the topics about Ja...
by slxst
Sat Jul 21, 2007 5:06 pm
Forum: Volume 112 (11200-11299)
Topic: 11215 - How Many Numbers?
Replies: 11
Views: 4989

I been thinking about this problem and the algorithm I thinking is straightforward but it seems too slow: Create an array "ops" with the four operations: +, -. *, / Read an array "numbers" and store the n numbers of input Create a function to create all possible sets of size n-1 where each element b...
by slxst
Mon Oct 16, 2006 2:30 am
Forum: Volume 111 (11100-11199)
Topic: 11110 - Equidivisions
Replies: 33
Views: 19211

Could someone provide tricky test cases?

I checked all the possible flaws here discussed but my code doesn't fall on those. However I still get WA! :evil:


Go to advanced search