## Search found 26 matches

Sat Jun 16, 2012 7:28 pm
Forum: Volume 8 (800-899)
Topic: 872 - Ordering
Replies: 2
Views: 2908

### 872 - Ordering

Got 4 WAs to find out that the last line of output should be equal to an empty line...

Some help for others:
Input #1:

Code: Select all

``````1

A B C
A<B B<C C<A
``````

Code: Select all

``````NO

``````
Input #2:

Code: Select all

``````1

A B
A<B B<A
``````

Code: Select all

``````NO

``````
Good luck!
Wed Jun 13, 2012 4:15 pm
Forum: Volume 111 (11100-11199)
Topic: 11101 - Mall Mania
Replies: 25
Views: 10753

### Re: 11101 - Mall Mania

Finally solved it. :lol: Used JAVA BitSet to check if we already visited point... and thanks for idea about combining 2 integers. really nice! Got AC in 1.020 import java.util.BitSet; import java.io.InputStreamReader; import java.io.IOException; import java.io.BufferedReader; import java.io.OutputSt...
Wed Jun 13, 2012 2:42 am
Forum: Volume 111 (11100-11199)
Topic: 11101 - Mall Mania
Replies: 25
Views: 10753

### Re: 11101 - Mall Mania

wow! thanks for such idea about combining two integers... I'll try ! I optimized my JAVA code and got AC in 1.084 sec. I used BufferedReader and BufferedWriter. A faster way to combine two integers is to use shift and bitwise and. I kept the distance in it's own 2-D array and placed x and y into the...
Wed Jun 13, 2012 1:39 am
Forum: Volume 111 (11100-11199)
Topic: 11101 - Mall Mania
Replies: 25
Views: 10753

### Re: 11101 - Mall Mania

Can you show your JAVA solution? maybe we can make it faster?
and the last question: my algo is ok?
brianfry713 wrote:My C++ code that got AC in 0.752 sec I rewrote in JAVA and got TLE.
Tue Jun 12, 2012 10:28 am
Forum: Volume 111 (11100-11199)
Topic: 11101 - Mall Mania
Replies: 25
Views: 10753

### Re: 11101 - Mall Mania

hey! Its really impossible to solve this problem using class Pair and each time creating a new object... so I decided to encode coordinates X, Y and distance in one number (it was "long"). I took 1997 because it doesnt matter at all... I have just tested and had all the time TLE. But for sure this P...
Mon Jun 11, 2012 9:43 pm
Forum: Volume 111 (11100-11199)
Topic: 11101 - Mall Mania
Replies: 25
Views: 10753

### Re: 11101 - Mall Mania

Nothig... just TLE... is it possible to solve in java? I am using BFS from all the points from the first mall and when I rich any point from second mall - output the answer and exit. am I doing something wrong? or I have TLE 'cause the input data is so large? Thanks. Here is my code: http://paste.ub...
Sun Jun 10, 2012 5:22 pm
Forum: Volume 9 (900-999)
Topic: 908 - Re-connecting Computer Sites
Replies: 21
Views: 8348

### Re: 908-Re-connecting Computer Sites

Nothing wrong, but we should remember that second line (aka MST of K+M edges) should be min(cost_before, cost_after).
Shafaet_du wrote:Whats wrong with problem description? just add the costs of first N-1 inputs,and thats the first output. find MST of last K+M inputs,thats the 2nd output.
Sat Jun 09, 2012 12:39 am
Forum: Volume 111 (11100-11199)
Topic: 11101 - Mall Mania
Replies: 25
Views: 10753

### Re: 11101 - Mall Mania

brianfry713 wrote:Your input is not valid. The malls do not intersect, even in one point. I tested the judge's input.
thank you very much! Ill try with this ...
Fri Jun 08, 2012 12:48 pm
Forum: Volume 111 (11100-11199)
Topic: 11101 - Mall Mania
Replies: 25
Views: 10753

### Re: 11101 - Mall Mania

Thank you for replying! But why its 1 instead of 0 or 2 on this test case: 4 0 0 0 1 1 1 1 0 6 3 2 3 1 2 1 1 1 1 2 2 2 we have 2 blocks which intersect just in 1 dot, so what we should count - minimal blocks which should walk Kim or minimal crosses of streets/avenues ? My AC output for the input you...
Thu Jun 07, 2012 6:28 pm
Forum: Volume 111 (11100-11199)
Topic: 11101 - Mall Mania
Replies: 25
Views: 10753

### Re: 11101 - Mall Mania

Can someone help me with this problem? I am always getting WAs... is this output|input data is correct? INPUT 4 0 0 0 1 1 1 1 0 6 4 3 4 2 3 2 2 2 2 3 3 3 4 0 0 0 1 1 1 1 0 6 3 2 3 1 2 1 1 1 1 2 2 2 4 0 0 0 1 1 1 1 0 6 2 2 2 1 1 1 0 1 0 2 1 2 0 OUTPUT: 2 2 1 Here is my code: http://paste.ubuntu.com/1...
Tue Jun 05, 2012 10:13 pm
Forum: Volume 107 (10700-10799)
Topic: 10731 - Test
Replies: 13
Views: 5385

### Re: 10731 - Test

huh... solved
remember, that last line should be an empty line.

good luck!
Tue Jun 05, 2012 6:31 pm
Forum: Volume 6 (600-699)
Topic: 657 - The die is cast
Replies: 46
Views: 21239

### Re: 657 - The die is cast

Hai! Thanks for reply. When I send my code, I change System.getProperty("ONLINE_JUDGE") != null); to console(true);//System.getProperty("ONLINE_JUDGE") != null); and it uses console... so its not a problem. I am getting crazy solving this problem... :evil: Don't read and write to a file. rewrote my ...
Mon Jun 04, 2012 9:06 pm
Forum: Volume 4 (400-499)
Topic: 459 - Graph Connectivity
Replies: 132
Views: 24145

### Re: 459 - Graph Connectivity

realy crazy output :lol: had to submit for 100500 time ... LAST line should be empty in your output. I thought that the problem was in reading input... but its ok. first you can read all input data except empty lines... after that - parse it and solve. example from my code: ArrayList<String> input =...
Mon Jun 04, 2012 6:02 pm
Forum: Volume 6 (600-699)
Topic: 657 - The die is cast
Replies: 46
Views: 21239

### Re: 657 - The die is cast

I am getting crazy solving this problem... :evil: here is my code: http://paste.ubuntu.com/1023130/ I have tested ALL data that I found here... I have checked my algo with all possible and impossible test cases... works OK... but system shows me WA. Really need help. Thx. import java.io.*; //import ...
Thu May 31, 2012 1:36 pm
Forum: Bugs and suggestions
Topic: Bug in resulting system verdict.
Replies: 1
Views: 3118

### Bug in resulting system verdict.

I have send many codes for http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=&problem=400&mosmsg=Submission+received+with+ID+10174951 problem... Why I have WA instead of RE ? import java.io.*; //import java.math.BigInteger; import java.util.*; //import j...