Search found 15 matches

by afruizc
Fri Jul 05, 2013 10:33 pm
Forum: Volume 104 (10400-10499)
Topic: 10465 - Homer Simpson
Replies: 75
Views: 22701

Re: 10465 - Homer Simpson

Sample input All the ones that are getting WA; here is some sample I/O. 6102 7869 9130 8146 3101 8746 9491 5930 9701 3450 7301 9451 4444 7247 8779 6001 8117 9411 6809 7336 7365 8614 8505 9119 351 7226 8020 2903 7008 9534 6223 101 8849 2603 7592 9602 62 9083 9553 263 427 7383 59 9468 9522 8727 989 91...
by afruizc
Sun Jan 20, 2013 8:06 pm
Forum: Volume 113 (11300-11399)
Topic: 11341 - Term Strategy
Replies: 20
Views: 7818

Re: 11341 - Term Strategy

Hello guys. I keep getting WA in this problem, I tried to solved it using backtracking and Memoization. The idea as follows: for each subject, you can choose to study certain amount of hours and jump right to the next subject, or you can choose no to study and ignore this current hour, this would le...
by afruizc
Tue Jan 08, 2013 2:33 am
Forum: Volume 106 (10600-10699)
Topic: 10600 - ACM Contest and Blackout
Replies: 34
Views: 13269

Re: 10600 - ACM Contest and Blackout

Yeah, I didn't really know what was wrong. I rewrote my code and get AC...
by afruizc
Tue Jan 08, 2013 2:29 am
Forum: Volume 118 (11800-11899)
Topic: 11833 - Route Change
Replies: 13
Views: 3970

Re: 11833 - Route Change

I am so dumb. :oops:

After several WA, I finally get AC. Thanks for your help Brianfry, as always you and your kindness !
by afruizc
Mon Jan 07, 2013 3:16 pm
Forum: Volume 118 (11800-11899)
Topic: 11833 - Route Change
Replies: 13
Views: 3970

Re: 11833 - Route Change

Thanks for your answer. I understand why that works, but what criteria do I use to know that a path leads out of a service route. For example at node 0 there are three edges, and one of them is 0-1, and the other two are edges to "random" nodes. How do I decide which of those two nodes is the incomi...
by afruizc
Sun Jan 06, 2013 7:38 pm
Forum: Volume 118 (11800-11899)
Topic: 11833 - Route Change
Replies: 13
Views: 3970

Re: 11833 - Route Change

What would be the output for this case:

Code: Select all

7 10 4 1
0 1 2
0 6 1
0 5 7
6 5 3
6 1 9
5 4 2
4 3 4
4 6 10
3 2 8
6 2 3
0 0 0 0
In my algo I remove all the edges that could form a service route, i.e. (4-0, 4-1, 4-2) and then run Dijkstra on that graph. Does that work?
by afruizc
Sat Jan 05, 2013 4:56 pm
Forum: Volume 117 (11700-11799)
Topic: 11705 - Grasshopper
Replies: 5
Views: 2677

Re: 11705 -- Grasshopper

Thanks Brianfry713 for you cases. I found out my code has got a bug. The thing is that I don't know where it is.

Here is it:

Code: Select all

Just use a rank function instead of comparison when getting a better path. 
by afruizc
Fri Dec 21, 2012 7:47 am
Forum: Volume 108 (10800-10899)
Topic: 10801 - Lift Hopping
Replies: 56
Views: 26768

Re: 10801 - Lift Hopping

Thanks brianfry713, I did as you said and get AC. It was my first time coding Dijkstra that way, but it is indeed less error prone. Thanks for your help :D. For those who are still stuck, here are some test cases: Input: 3 30 100 100 1 0 2 4 5 6 7 8 21 22 23 24 25 26 30 1 2 11 12 13 14 15 16 19 30 1...
by afruizc
Mon Dec 17, 2012 8:16 pm
Forum: Volume 108 (10800-10899)
Topic: 10801 - Lift Hopping
Replies: 56
Views: 26768

Re: 10801 - Lift Hopping

The key to solve this problem is to model the graph successfully I think that's what I'm lacking, because I keep getting WA. Here is the idea I used: I associate a number to every floor depending on the elevator that goes over that floor. For the first elevator I give the floors numbers from 0 to 99...
by afruizc
Wed Dec 12, 2012 9:46 am
Forum: Volume 106 (10600-10699)
Topic: 10600 - ACM Contest and Blackout
Replies: 34
Views: 13269

Re: 10600 - ACM Contest and Blackout

I have solved this problem, but I'm getting RTE. I've used the next procedure: For the first MST, simply run kruskal and print the MST value, also every time an edge is added to the Tree, I add it to a vector to keep track of it later. After this process, I take every one of the edges, I flag the ed...
by afruizc
Sun Dec 09, 2012 8:12 am
Forum: Volume 104 (10400-10499)
Topic: 10422 - Knights in FEN
Replies: 49
Views: 17693

Re: 10422 - Knights in FEN

Im getting WA and I don't know why. My code passes all I/O posted int this thread. The idea is to run BFS for the first 10 layers, then stop. After that, I get the input and see if there is a solutions so far. If there is, I output it, if not, I output the "Unsolvable in less than 11 move(s).". Here...
by afruizc
Tue Dec 04, 2012 10:45 am
Forum: Volume 5 (500-599)
Topic: 598 - Bundling Newspapers
Replies: 25
Views: 8968

Re: 598: Bundling eccentric newspapers

I don't know what wrong with My code. I've reviewed it several times. It's passed all the test cases so far. I'm getting WA if anyone can help me I would really appreciate.

Code: Select all

Acc....
Removed after realizing a wasn't doing what was asked int the problem description
by afruizc
Tue Dec 04, 2012 1:31 am
Forum: Volume 115 (11500-11599)
Topic: 11513 - 9 Puzzle
Replies: 10
Views: 5040

Re: 11513 - 9 Puzzle

I took a different approach. I run bfs at the beginning from the state 1 2 3 4 5 6 7 8 9 Then, When reading the cases I looked them up if there was solution. Notes: - The printing of the moves is slightly different. - The moves are done the opposite way because we are starting from the target state.
by afruizc
Tue Dec 04, 2012 1:23 am
Forum: Volume 104 (10400-10499)
Topic: 10475 - Help the Leaders
Replies: 24
Views: 10734

Re: 10475 - Help the Leaders

The trick is to convert everything to uppercase. Even the given constraints. I got like 5 WA before noticing after converting them, I got AC. You can do that when you read the input.
by afruizc
Sat Oct 13, 2012 2:14 am
Forum: Volume 3 (300-399)
Topic: 315 - Network
Replies: 68
Views: 21443

Re: 315 Network

I have looked in everyones codes. I'm using Tarjan algorithm to find Articulation points. I had some problems representing the graph as an Adjacency List, so I changed it to a matrix, but still WA.
Here is my code:

Code: Select all

Cut after AC..
I would really appreciate if some helps me out

Go to advanced search