Search found 22 matches

by Bruno
Thu Aug 30, 2012 3:45 am
Forum: Volume 101 (10100-10199)
Topic: 10160 - Servicing Stations
Replies: 20
Views: 13637

Re: 10160 - Servicing Stations

Test cases are weak, got acc with an internet code, it fails on this test (it handles multiple edges and/or self loops if there is any, I didnt checked the input, just generated a random one..): 29 91 20 25 28 19 13 10 23 1 2 25 2 19 26 8 1 2 17 16 9 13 3 12 14 1 4 16 28 6 26 9 4 3 22 8 17 23 15 26 ...
by Bruno
Tue Jun 14, 2011 1:20 am
Forum: Volume 109 (10900-10999)
Topic: 10982 - Troublemakers
Replies: 17
Views: 6390

Re: 10982 - Troublemakers

What is wrong with my code (WA), I am using Per idea:

Code: Select all

 Removed after AC
Edit--

The random idea is very cool :D, my mistake was that the total of pairs must be at most m/2 on both rooms, not m/2 in each one.. Thank you Igor for clarifying that for me!
by Bruno
Sat Jun 11, 2011 12:04 am
Forum: Volume 103 (10300-10399)
Topic: 10380 - Shogi Tournament
Replies: 10
Views: 4982

Re: 10380 - Shogi Tournament

If I set the games as nodes, linking with the guys, on the worst case (50 guys) there will be +- 2000 games (vertexes), and +- 4000 links (edges)? Is that right? Edmons-Karp is VE², I guess it wont run on time :/ .. I used the wikipedia code and for 50 guys it is still running.. is there any improve...
by Bruno
Sat Jun 04, 2011 1:17 am
Forum: Volume 101 (10100-10199)
Topic: 10159 - Star
Replies: 9
Views: 2899

Re: 10159 - Star

Humm, so if there is some lines that collide forming 3 I choose that? I did not understand very well, what happens in this case: A B C D E F G H I J K L 1 1 1 1 1 1 1 1 1 1 1 0 - combine A, E, J - combine B, F, K - now C can only combine to remove 2, which one to choose? I can choose C, F, I for exa...
by Bruno
Thu Jun 02, 2011 1:40 am
Forum: Volume 101 (10100-10199)
Topic: 10159 - Star
Replies: 9
Views: 2899

Re: 10159 - Star

Finally got accepted! The idea above is correct :D, I was making a little mistake on the complete search, I forgot to check in the arrangements to check if the third line is OK too, this test case was giving me wrong output:

Code: Select all

9 7 3 8 8 5 0 1 4 9 7 1
The correct output is:

Code: Select all

44 131
Thank you!
by Bruno
Wed Jun 01, 2011 11:53 pm
Forum: Volume 101 (10100-10199)
Topic: 10159 - Star
Replies: 9
Views: 2899

Re: 10159 - Star

I cant get an AC, here are some input and my output: 5 7 8 9 6 1 9 0 9 8 4 6 5 7 8 9 6 1 9 0 9 8 9 6 1 2 3 4 1 1 1 4 1 1 4 1 1 1 1 4 1 1 1 4 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 2 1 7 6 2 9 7 1 0 2 3 4 9 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3...
by Bruno
Sun Sep 26, 2010 8:04 pm
Forum: General
Topic: Waterloo Local 2010, Fall 1
Replies: 6
Views: 4758

Re: Waterloo Local 2010, Fall 1

Not Found

The requested URL /contests/263-3e9bb4ed/index.html was not found on this server.
Apache Server at uva.onlinejudge.org Port 80

:/
by Bruno
Sun Sep 05, 2010 7:46 pm
Forum: Volume 101 (10100-10199)
Topic: 10154 - Weights and Measures
Replies: 60
Views: 40682

Re: 10154 - Weights and Measures

I used the greedy approach, but its giving WA :/, I tried all the inputs here on this thread and its all ok. Could anyone post more inputs? Thank you!
by Bruno
Sat May 08, 2010 12:54 am
Forum: Volume 5 (500-599)
Topic: 544 - Heavy Cargo
Replies: 32
Views: 14714

Re: 544 - heavy cargo

I am doing a maximum spanning tree and then finding the min weight between the source and dest, and its giving me WA :cry: , is this correct?
by Bruno
Thu Nov 05, 2009 3:09 pm
Forum: Volume 100 (10000-10099)
Topic: 10023 - Square root
Replies: 121
Views: 28582

Re: 10023 - Square Root

Following little joey algorithm (Pells equations, etc..) I got a very fast result! I tryed all the test cases from mukeshtiwari and all answers are equal! But I am getting WA :o EDIT--- Got accpeted finally! :P The problem was that in the last result I was printing a blank line too :evil: . Resuming...
by Bruno
Wed Nov 04, 2009 11:42 pm
Forum: Volume 116 (11600-11699)
Topic: 11686 - Pick up sticks
Replies: 44
Views: 10871

Re: 11686 How can

arifcsecu wrote:Read previous post
Which one? :o
by Bruno
Wed Nov 04, 2009 12:09 am
Forum: Volume 116 (11600-11699)
Topic: 11686 - Pick up sticks
Replies: 44
Views: 10871

Re: 11686 How can

Got accepted, I was forgetting to clear the vectors :oops:

Anyway, I needed to change from cin to scanf! With cin I got TLE! This should be considered by the judges as cin/scanf should not interfere in the algorithm complexity and performance :-? Should it??? :o
by Bruno
Tue Nov 03, 2009 5:55 pm
Forum: Volume 116 (11600-11699)
Topic: 11686 - Pick up sticks
Replies: 44
Views: 10871

Re: 11686 How can

I am getting WA, anybody could give me another sample input (one that may fail)?

I tried this:

Code: Select all

4 3
4 1
1 2
3 2
3 2
1 2
2 3
4 4
2 1
3 2
4 3
2 4
0 0
And output is:

Code: Select all

4
1
3
2
1
2
3
IMPOSSIBLE
Just like the toolkit :o
by Bruno
Fri Oct 30, 2009 1:38 pm
Forum: Volume 115 (11500-11599)
Topic: 11510 - Erdös Unit Fractions
Replies: 2
Views: 2392

Re: 11510 - Erdös Unit Fractions

I apparently found a very quick way to find x y and z with even numbers and odd numbers in the form 3 + 4k, all based on the 4/n thing that you can write it as a form of 2 unit fractions. But I would like to know how to calculate for prime numbers !
by Bruno
Thu Oct 29, 2009 5:37 pm
Forum: Volume 117 (11700-11799)
Topic: 11714 - Blind Sorting
Replies: 14
Views: 3461

Re: 11714 Blind Sorting

Thanks Igor!

After analyzing a bit more, here is a tip, you dont need to check if its power of 2! (You will need to change something with the formula) :D

Go to advanced search