Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Страница 2 |
hint | 👾_challenger128_[PermSU] | 1056. Центры сети | 13 мар 2021 00:05 | 1 |
hint 👾_challenger128_[PermSU] 13 мар 2021 00:05 th: deleting leafes doesn't change centers |
hint | arun | 1056. Центры сети | 6 июн 2016 10:53 | 1 |
hint arun 6 июн 2016 10:53 try to locate the centre of the diameter of the tree ! O(N) |
Idea O(N) | Felix_Mate | 1056. Центры сети | 4 ноя 2019 15:11 | 2 |
I got AC! It's nice problem! My algo works at O(3*N)=O(N). 1)BFS from any vertex and find the most remote vertex (let V); 2)BFS from V and find the most remote vertex (let U); 3)Create path from U and V; vertex(vertexes) in the middle is answer. Edited by author 04.08.2015 12:56 |
WA2 help PLEASE! | Kate | 1056. Центры сети | 22 дек 2013 20:48 | 1 |
|
переведите задание | efg | 1056. Центры сети | 1 окт 2012 15:37 | 1 |
|
hint on solution | askhatik | 1056. Центры сети | 22 июн 2012 18:46 | 1 |
use DFS with memorization |
diametr | Abzal | 1056. Центры сети | 27 июн 2012 01:47 | 2 |
this problem is solved by using diametr of graph, isn't it?! Re: diametr Alexey Dergunov [Samara SAU] 27 июн 2012 01:47 |
Why I get TLE when I use forwards star but AC for vector? | Power_OJ4 | 1056. Центры сети | 2 авг 2011 07:18 | 1 |
// forwards star int num,adj[10005]; struct edge {int v,pre;}e[10005]; void insert(int u,int v) { e[num].v=v; e[num].pre=adj[u]; adj[u]=num++; } for(i=adj[x];~i;i=e[i].pre) { } Edited by author 02.08.2011 07:19 |
:-))) | Qafqaz Sehriyar Novruzov | 1056. Центры сети | 17 июн 2011 15:51 | 1 |
:-))) Qafqaz Sehriyar Novruzov 17 июн 2011 15:51 |
what algo should i use,I had memory limit,then time limit and now again time limi 2.046s 1.037kb? | Hrayr | 1056. Центры сети | 17 июн 2011 14:34 | 2 |
what algo should i use,I had memory limit,then time limit and now again time limit 2.046s 1.037kb? |
I know 2 souluions,first gets TLE test9 and second gets MLE test 9.How can i use less memory or a little time. | Hrayr | 1056. Центры сети | 12 июн 2011 20:18 | 1 |
I know 2 souluions,first gets TLE test9 and second gets MLE test 9.How can i use less memory or a little time. Edited by author 12.06.2011 20:18 Edited by author 12.06.2011 20:18 |
How to get memory less than 16 mb? | Hrayr | 1056. Центры сети | 3 июн 2011 23:12 | 1 |
I used graf[n][n] and got MLE on test9.My solution is O(n^2). Edited by author 05.06.2011 15:08 |
why I was WA5,who can tell me what the test 5 like? | uuu | 1056. Центры сети | 21 апр 2010 20:32 | 1 |
|
Hint O(n^2) | Hanzbrow (TNU) KCC | 1056. Центры сети | 16 апр 2010 21:14 | 2 |
vector<set<int> > and if WA 5 then test this: 9 1 2 3 4 5 6 7 8 and 10 1 2 3 4 5 6 7 8 9 Hmmmmm.... O(n^2) is too slow (-_-). I know O(N+M) solution.You have just to delte leaves, while number of vertex>2.If you will do it righ,you will get O(N+M)solution. |
Maybe test data is weak?(-) | tiancaihb | 1056. Центры сети | 6 авг 2009 14:58 | 2 |
For data:5 5 4 5 1 I know it's illegal according to the statement,but it's the only one I can find now. However,I believe there is an "legal" one which may make some AC prog wrong ans! My AC prog says 5 4! I used bfs twice,and I didn't sort the 2 numbers! Perhaps there is no data figures out this problem. btw,I fixed my prog at once.Sorry for my poor English. Edited by author 06.08.2009 14:41 Edited by author 06.08.2009 14:47 Sorry,but now I know maybe there isn't a "legal" data that makes error. I can't prove it well,but it's true:when use 2bfs,you needn't sort 2 num. See: Divide the tree into 2 parts,L and R. The answer,if 2 num,must be in the longer part.Let's say it's on the right. First you bfs to right,then bfs to leftmost. When you follow the longest chain back again,you are going to right side. If the data is legal,part R is in inscend(I don't know how to spell) order.So ans num1<ans num2. so you needn't sort them at all! |
Страница 1 |
why WA Orz......PLZ help me` | OPheadache_h | 1056. Центры сети | 5 авг 2009 20:56 | 1 |
var n,i,j,k,x:longint; f:array[1..10000,0..100]of longint; ff:array[1..10000]of boolean; begin readln(n); fillchar(f,sizeof(f),0); for i:=2 to n do begin readln(x); inc(f[i,0]); inc(f[x,0]); f[i,f[i,0]]:=x; f[x,f[x,0]]:=i; end; fillchar(ff,sizeof(ff),true); while n>2 do begin for i:=1 to n do if f[i,0]=1 then begin dec(f[i,0]); ff[i]:=false; dec(f[f[i,1],0]); for j:=1 to f[f[i,1],0] do if f[f[i,1],j]=i then begin for k:=j to f[f[i,1],0] do f[f[i,1],k]:=f[f[i,1],k+1]; break; end; dec(n); end; end; if n=1 then for i:=1 to n do if ff[i] then writeln(i); if n=2 then begin for i:=1 to n do if ff[i] then begin write(i,' '); break; end; for i:=i+1 to n do if ff[i] then writeln(i); end; end. |
Somebody give test1 | Husan | 1056. Центры сети | 11 янв 2009 15:43 | 2 |
|
Test #5? | hhoriah | 1056. Центры сети | 1 июн 2009 21:23 | 2 |
Does anybody have test #5? Is there anything special with it? Thanks! Try this one: 9 1 2 3 3 2 6 6 6 I don't think it matches the test #5, but it helped me after I had got WA5. |
Test #5 | Carbon | 1056. Центры сети | 23 авг 2008 11:33 | 3 |
Please, tell me what does that test look like? I'm failing the same test. Can anybody provide it or some details about it? Edited by author 24.08.2008 03:57 |
please can anybody provide me some test cases i am getting WA on test 4 | Anupam Ghosh,Bengal Engg and Science University,Shibpur,India | 1056. Центры сети | 22 авг 2011 16:29 | 2 |
please can anybody provide me some test cases i am getting WA on test 4. secondly what is meant by remote computers?? remote - means the further |