Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
For WA#12 | springWaltz | 1145. Нить в лабиринте | 29 ноя 2021 14:49 | 1 |
|
Hint | die_young | 1145. Нить в лабиринте | 11 июл 2018 00:19 | 1 |
Hint die_young 11 июл 2018 00:19 The problem asks you to find the diameter of a tree. |
If you have WA13 | shardex | 1145. Нить в лабиринте | 2 окт 2017 22:07 | 1 |
Try this test: 4 3 #### #..# #### Answer is 1 :) |
If the size of matriz is 3... | GastonFontenla | 1145. Нить в лабиринте | 16 янв 2017 09:15 | 2 |
If the matrix size is 3, with the given contraints, it won't be "2 special cells", because 8 of them will be walls, and will be only one free cell. Could be that those special cells were located at the same place? Please drop some light on that. Thanks looks like someone has found a special case here ;) either 3x4 or 4x3 has two points, 3x3 does not |
be carefull | sobhan_cp | 1145. Нить в лабиринте | 15 июл 2013 18:51 | 1 |
cin>>n>>m not while(cin>>n>>m) |
Problem 1145 "Rope in the Labyrinth" has been rejudged | Vladimir Yakovlev (USU) | 1145. Нить в лабиринте | 25 апр 2013 00:10 | 1 |
Memory limit was changed from 16 MB to 64 MB. 12 authors have got AC after rejudge. |
Why WA#13 | Proba | 1145. Нить в лабиринте | 18 ноя 2011 23:57 | 2 |
My program haved AC, but after rejudge have WA13. How is this possible? Number of tests was less than 13? I sent two different solutions with the DFS and BFS, аnd they both have WA13. sorry, i find bug in my solution. Tests is correct... Edited by author 29.11.2011 22:39 |
Weak tests | Fyodor Menshikov | 1145. Нить в лабиринте | 14 ноя 2011 21:37 | 5 |
Test generated by the following program is hard for recursive solutions on some languages. For example Java recursive solution uses approx 31M of stack on this test while the whole ML of this problem is 16M. Very very strange that the test set does not contain test with maximal possible answer. const height = 1000; width = 1000; var line, column : integer; begin writeln(height, ' ', width); for line := 1 to height do begin for column := 1 to width do begin if (line = 1) or (line = height) or (column = 1) or (column = width) or (line mod 4 = 1) and (column > 2) or (line mod 4 = 3) and (column < width - 1) then begin write('#'); end else begin write('.'); end; end; writeln; end; end. Edited by author 09.01.2009 17:29 Answer 498500 Edited by author 17.03.2011 03:31 Some tests with n ≠ m were added. 113 authors lost AC. |
Help me! | AXIS | 1145. Нить в лабиринте | 1 янв 2011 16:11 | 14 |
I always got Stack Overflow on test 6, help! [code deleted] Edited by moderator 13.02.2007 20:52 I don't remeber... Add this text in your program, before {APPTYPE CONSOLE} {$MAXSTACKSIZE $10000000} This number it is your stack size. Thanks) Stack size don't work, i tried. P.S. How to BFS?) Thanks) Stack size don't work, i tried. ) Whats the problem?? {$M 16000000} //From FAQ It's a kind of magic) i've forgotten Pascal completely... MaxStackSize - this is Delphi code... Now, it's WA6=) This problem gonna take my brain... Why WA??? It's a kind of magic) i've forgotten Pascal completely... MaxStackSize - this is Delphi code... Now, it's WA6=) The $MINSTACKSIZE and $MAXSTACKSIZE directives are used in Windows programming only. As I know 2 DFS is needed for this problem I've written two BFS - WA6. My idea in this code - finding in the vertex V the furthest vertexes, that they are in different subtrees in tree with root V. Something like that, hard to explain) First BFS - finding the free cell A that is the furthest from some free cell. Second BFS - finding the free cell B that is the furthest from cell A. AC finally.. But i don't understand, why dfs solve doesn't work AC finally.. But i don't understand, why dfs solve doesn't work I've solved it with dfs It's very simple and fast If you want I can send my solution to you Just 2 waves. I had WA#6, when I used short int instead of int for my lenght variable. Thanks {$M 16000000} helped me. finaly AC with 0.046s, but 10Mb memory. I used simple recursion. |
Tricky solution | KALO | 1145. Нить в лабиринте | 29 июл 2009 04:48 | 1 |
Use simulation with a big array... I got AC with int[50000][3] in 0.156s in Java. |
Can this be done with O(N) memory ? | Chen Tsung | 1145. Нить в лабиринте | 21 авг 2008 17:20 | 3 |
Can this be done with O(N) memory ? Possibly yes. But in O(N^3) time which is inacceptible. Edited by author 07.09.2008 21:52 |
WA1 | Eustas | 1145. Нить в лабиринте | 21 авг 2008 12:37 | 1 |
WA1 Eustas 21 авг 2008 12:37 Trying to solve this simple problem and always get WA1. Tried to read input by chars/by lines. Tried to output with endline and without... Got some questions. What is correct answer for: 3 3 ### #.# ### ...and for: 3 3 ### ### ### ...is such input correct: 3 3 #.# ... #.# May be i'm on wrong way - my algo is - create a list of leaves of tree; delete them and increment counter; repeat until leaves list is empty. answer is doubled counter - 1 or doubled counter if one vertex left in tree. |
Sample | Sandro (USU) | 1145. Нить в лабиринте | 15 июн 2006 20:34 | 3 |
Sample Sandro (USU) 15 июн 2006 11:10 ...The next lines describe the labyrinth. The ith line of the next m lines contains n characters. Each character is either "#" or ".", with "#" indicating a forbidden cell, and "." indicating a free cell (i = 1, 2, ..., m)... But in sample input the last character in the 1st line of labyrinth is space. |
I think this is a good problem.I try hard to compress the memory and use a maths way to prove my algorithm is right.At last,I got AC. | Yu YuanMing | 1145. Нить в лабиринте | 29 июн 2004 21:19 | 1 |
|