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 ...
Search found 22 matches
- Thu Aug 30, 2012 3:45 am
- Forum: Volume 101 (10100-10199)
- Topic: 10160 - Servicing Stations
- Replies: 20
- Views: 18039
- Tue Jun 14, 2011 1:20 am
- Forum: Volume 109 (10900-10999)
- Topic: 10982 - Troublemakers
- Replies: 17
- Views: 8275
Re: 10982 - Troublemakers
What is wrong with my code (WA), I am using Per idea:
Edit--
The random idea is very cool
, 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!
Code: Select all
Removed after AC
The random idea is very cool

- Sat Jun 11, 2011 12:04 am
- Forum: Volume 103 (10300-10399)
- Topic: 10380 - Shogi Tournament
- Replies: 10
- Views: 6090
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 ...
- Sat Jun 04, 2011 1:17 am
- Forum: Volume 101 (10100-10199)
- Topic: 10159 - Star
- Replies: 9
- Views: 3779
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 ...
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 ...
- Thu Jun 02, 2011 1:40 am
- Forum: Volume 101 (10100-10199)
- Topic: 10159 - Star
- Replies: 9
- Views: 3779
Re: 10159 - Star
Finally got accepted! The idea above is correct
, 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:
The correct output is:
Thank you!

Code: Select all
9 7 3 8 8 5 0 1 4 9 7 1
Code: Select all
44 131
- Wed Jun 01, 2011 11:53 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10159 - Star
- Replies: 9
- Views: 3779
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 ...
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 ...
- Sun Sep 26, 2010 8:04 pm
- Forum: General
- Topic: Waterloo Local 2010, Fall 1
- Replies: 6
- Views: 5589
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
:/
The requested URL /contests/263-3e9bb4ed/index.html was not found on this server.
Apache Server at uva.onlinejudge.org Port 80
:/
- Sun Sep 05, 2010 7:46 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10154 - Weights and Measures
- Replies: 60
- Views: 48677
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!
- Sat May 08, 2010 12:54 am
- Forum: Volume 5 (500-599)
- Topic: 544 - Heavy Cargo
- Replies: 32
- Views: 18459
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
, is this correct?

- Thu Nov 05, 2009 3:09 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10023 - Square root
- Replies: 121
- Views: 45400
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 ...
EDIT---
Got accpeted finally! :P
The problem was that in the last result I was printing a blank line too :evil ...
- Wed Nov 04, 2009 11:42 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11686 - Pick up sticks
- Replies: 44
- Views: 17165
Re: 11686 How can
Which one?arifcsecu wrote:Read previous post

- Wed Nov 04, 2009 12:09 am
- Forum: Volume 116 (11600-11699)
- Topic: 11686 - Pick up sticks
- Replies: 44
- Views: 17165
Re: 11686 How can
Got accepted, I was forgetting to clear the vectors
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??? 

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


- Tue Nov 03, 2009 5:55 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11686 - Pick up sticks
- Replies: 44
- Views: 17165
Re: 11686 How can
I am getting WA, anybody could give me another sample input (one that may fail)?
I tried this:
And output is:
Just like the toolkit 
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
Code: Select all
4
1
3
2
1
2
3
IMPOSSIBLE

- Fri Oct 30, 2009 1:38 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11510 - Erdös Unit Fractions
- Replies: 2
- Views: 2894
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 !
- Thu Oct 29, 2009 5:37 pm
- Forum: Volume 117 (11700-11799)
- Topic: 11714 - Blind Sorting
- Replies: 14
- Views: 5049
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)
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)
