Actually the problem limits are too loose. It should disallow O(V^2) type of solutions. It should be O(V).
1) The better solution is first construct SCC (strongly connected components), as well as the DAG after SCC decomposition.
2) Perform bellman ford negative cycle detection on only one node ...
Search found 16 matches
- Wed Oct 28, 2009 5:07 am
- Forum: Volume 117 (11700-11799)
- Topic: 11721 - Instant View of Big Bang
- Replies: 12
- Views: 7882
- Tue Oct 27, 2009 7:23 pm
- Forum: Volume 117 (11700-11799)
- Topic: 11721 - Instant View of Big Bang
- Replies: 12
- Views: 7882
Re: 11721 - "Instant View of Big Bang"
Would you like to share your approach for this problem?
@gaurav2289: My approach is like, extract the kernel DAG of the graph using Tarjan's algorithm. Then, run Bellmann-Ford for each strongly connected component (aka: SCC) and see if there is a negative cycle. If there is, then the cycle is ...
@gaurav2289: My approach is like, extract the kernel DAG of the graph using Tarjan's algorithm. Then, run Bellmann-Ford for each strongly connected component (aka: SCC) and see if there is a negative cycle. If there is, then the cycle is ...
- Tue Oct 27, 2009 12:32 am
- Forum: Volume 117 (11700-11799)
- Topic: 11721 - Instant View of Big Bang
- Replies: 12
- Views: 7882
Re: 11721 - "Instant View of Big Bang"
@gaurav2289:
I think you are idea is correct when there is only one negative cycle. Try with:
1000 9
10 11 -10
11 12 -10
12 10 10
998 999 -10
999 998 9
800 12 1000
750 999 1000
750 111 -1000
111 750 1000
The correct output is:
Case 1: 10 11 12 111 750 800 998 999
@admins:
I think the ...
I think you are idea is correct when there is only one negative cycle. Try with:
1000 9
10 11 -10
11 12 -10
12 10 10
998 999 -10
999 998 9
800 12 1000
750 999 1000
750 111 -1000
111 750 1000
The correct output is:
Case 1: 10 11 12 111 750 800 998 999
@admins:
I think the ...
- Thu Sep 25, 2008 5:02 pm
- Forum: FAQ
- Topic: About the new forum
- Replies: 13
- Views: 11520
Re: About the new forum
The auto-login works in google chrome.
- Sat Jul 12, 2008 11:02 pm
- Forum: Bugs and suggestions
- Topic: 10249 - The Grand Dinner
- Replies: 1
- Views: 1957
10249 - The Grand Dinner
Hi people.
This is just to report a small bug in the problem statement (http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&category=14&page=show_problem&problem=1190). In the Output section:
In case of a successful arrangement print M additional lines where the i ...
This is just to report a small bug in the problem statement (http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&category=14&page=show_problem&problem=1190). In the Output section:
In case of a successful arrangement print M additional lines where the i ...
- Fri May 23, 2008 8:13 pm
- Forum: FAQ
- Topic: About the new forum
- Replies: 13
- Views: 11520
Re: About the new forum
No, not working yet. I checked the cookie settings in my browser, and they are ok. Let me see if I can try that in our forum.Carlos wrote:That manual is phpbb2, we're using phpbb3.
I've modified the cookies setting, can you please try again to see if it works now?
- Thu May 22, 2008 12:43 pm
- Forum: FAQ
- Topic: About the new forum
- Replies: 13
- Views: 11520
Re: About the new forum
I found something about the auto-login configuration in the phpBB documentation:
http://www.phpbb.com/support/documentat ... ction3_2_2
Read the item labeled "Allow automatic logins", have you tried this?
http://www.phpbb.com/support/documentat ... ction3_2_2
Read the item labeled "Allow automatic logins", have you tried this?
- Wed May 21, 2008 6:16 am
- Forum: FAQ
- Topic: About the new forum
- Replies: 13
- Views: 11520
Re: About the new forum
The only problem I found is that the Auto-Login does not work, even if I mark the check box before logging in, when I open the forum I have to login again. Is this intentional? We (our university judge team) started a private forum like this one (using this phpBB version), and the auto-login does ...
- Sun Oct 28, 2007 7:18 pm
- Forum: Bugs and suggestions
- Topic: Sugestion
- Replies: 4
- Views: 2949
- Thu Sep 20, 2007 11:28 pm
- Forum: FAQ
- Topic: a question about submission
- Replies: 6
- Views: 9108
- Sun Sep 09, 2007 6:26 pm
- Forum: Bugs and suggestions
- Topic: ONLINE_JUDGE flag
- Replies: 4
- Views: 2690
- Sat Sep 08, 2007 3:47 pm
- Forum: Bugs and suggestions
- Topic: 496 - Simply Subsets
- Replies: 6
- Views: 5253
- Sat Sep 08, 2007 2:21 am
- Forum: Bugs and suggestions
- Topic: 496 - Simply Subsets
- Replies: 6
- Views: 5253
496 - Simply Subsets
Hi everybody. Can someone check the input for this problem. I submitted this code to the new server:
#include "stdio.h"
int main() {
static char buffer[1000000];
int cnt = 0;
while (fgets(buffer, 1000000, stdin) != NULL)
+cnt;
if (cnt % 2 != 0) {
char* c = NULL;
*c = '\0';
}
return 0 ...
#include "stdio.h"
int main() {
static char buffer[1000000];
int cnt = 0;
while (fgets(buffer, 1000000, stdin) != NULL)
+cnt;
if (cnt % 2 != 0) {
char* c = NULL;
*c = '\0';
}
return 0 ...
- Fri Sep 07, 2007 8:19 pm
- Forum: Bugs and suggestions
- Topic: ONLINE_JUDGE flag
- Replies: 4
- Views: 2690
ONLINE_JUDGE flag
Hi everybody. In the old system you used to define a ONLINE_JUDGE macro to make reading from file at home and from stdin at the OJ without problems. However, that flag is not declared anymore in the new sysem. Will it be added?
- Thu Aug 16, 2007 2:03 am
- Forum: Volume 2 (200-299)
- Topic: 278 - Chess
- Replies: 22
- Views: 6978