Search found 3 matches

by tymoszenko
Wed Sep 22, 2004 2:54 pm
Forum: Volume 107 (10700-10799)
Topic: 10701 - Pre, in and post
Replies: 13
Views: 8158

10701 - Pre, in and post

Hello!

I solved this problem (10701), but I am stell getting WA. I know that this problem is easy, but I can
by tymoszenko
Thu May 20, 2004 5:21 pm
Forum: Volume 100 (10000-10099)
Topic: 10000 - Longest Paths
Replies: 160
Views: 56508

I corrected this problem and got AC. I changed DFS for BFS.

[c]void BFS(int u, int n){
int tail, head, i, t;
for(i=0;i<n;i++) marked =-1;
head=tail=0;
queue[tail++]=u;
marked =0;
while(head!=tail){
u=queue[head++];
for(i=0;i<n;i++)
if (g &&marked <marked +1){
marked =marked +1;
queue ...
by tymoszenko
Mon Apr 26, 2004 7:31 pm
Forum: Volume 100 (10000-10099)
Topic: 10000 - Longest Paths
Replies: 160
Views: 56508

10000

Please help me.
I really don`t know why I got WA with this code.


#include <stdio.h>
int g[101][101], marked[101], parent[101], leaf[101], nl;

void refreshMarks(int u, int value, int n){
int i;
for(i=0;i<n;i++)
if (parent[i]==u){
marked[i]=value;
break;
}
if (i<n) refreshMarks(i, value+1 ...

Go to advanced search