Search found 69 matches

by jurajz
Sun Aug 16, 2009 12:00 am
Forum: Volume 116 (11600-11699)
Topic: 11624 - Fire!
Replies: 54
Views: 15157

Re: 11624 - Fire!

I try run your program and I think, that I found some wrong outputs. For example, for input: 5 1 1 J 1 2 J. 2 1 . J 2 2 .. .J 2 2 .. FJ your program returns IMPOSSIBLE 2 2 2 2 but correct output is 1 1 1 1 1 So, try to fix it, or think about only one BFS, or another implementation. Hope you will get...
by jurajz
Sat Aug 15, 2009 11:53 pm
Forum: Volume 116 (11600-11699)
Topic: 11624 - Fire!
Replies: 54
Views: 15157

Re: 11624 - Fire!

As Igor9669 wrote, one BFS is enough. In each step of BFS, at first "extend" the fire () and at second "extend" the move of Joe. I don't understand your implementation clearly, I used three 2-dimensional array, one for reading input, one for movement of Joe and one for extension of fire.
by jurajz
Fri Aug 14, 2009 10:40 pm
Forum: Volume 116 (11600-11699)
Topic: 11624 - Fire!
Replies: 54
Views: 15157

Re: 11624 - Fire!

Hi calicratis19, I think, that the reason of RTE may be here: array[1103] and then else if(cha=='F') { array[y]=i; array[y+1]=j; y+=2; Adjacent [ i ][ j ] = 1; } Think about case, when the maze has 1000 rows, 1000 columns and here is one "J" and 999999 "F". Array array should have length 1999998 (or...
by jurajz
Thu Jun 11, 2009 4:11 pm
Forum: Volume 102 (10200-10299)
Topic: 10255 - The knight's Tour
Replies: 14
Views: 5708

Re: 10255 - Knight's Tour

Hi, I made 8 Presentation Errors in this problem. I cannot find, where can I make mistake. For input 1 1 1 my output is four spaces+"1"+newline For input with no solution, my output is only one line: "No Circuit Tour."+newline For input with solution, my output is N lines, every line contains N numb...
by jurajz
Wed Mar 04, 2009 9:56 pm
Forum: Volume 114 (11400-11499)
Topic: 11452 - Dancing the Cheeky-Cheeky
Replies: 7
Views: 4089

Re: 11452 - Dancing the Cheeky-Cheeky

Hi lazyboy,

I don't know your idea, but my O(n^2) (n is length of the input string) algorithm pass time limit with no problem (0.010s). Maybe you got infinite loop at some judge test case... Just determine length of the period in O(n^2) and with help of this length write next 8 steps :)
by jurajz
Sun Feb 15, 2009 11:46 pm
Forum: Volume 115 (11500-11599)
Topic: 11573 - Ocean Currents
Replies: 12
Views: 3894

Re: 11573 - Ocean Currents

Here are my random-testcases, when someone have WA, this may help: Input: 10 10 6051134354 2321601626 4333237711 7100435246 1073373445 7444061776 7570714166 2261637531 6527302645 2035001421 50 2 3 4 1 8 7 8 6 8 2 10 7 2 5 8 5 2 1 3 1 10 3 6 6 10 6 2 4 10 8 4 5 3 1 5 5 1 4 4 5 10 8 9 7 5 8 3 7 10 8 7...
by jurajz
Sun Feb 15, 2009 11:40 pm
Forum: Volume 115 (11500-11599)
Topic: 11573 - Ocean Currents
Replies: 12
Views: 3894

Re: 11573 - Ocean Currents

Thanks one more time, finally I have AC.

By random-generated test cases I noticed really stupid mistake in my code - in my BFS I wrote "false" instead of "true" and that means, that I don't marked squares added to queue4 as visited. After this, I have WA, after fixing have AC in 1.060.
by jurajz
Sun Feb 15, 2009 2:28 pm
Forum: Volume 115 (11500-11599)
Topic: 11573 - Ocean Currents
Replies: 12
Views: 3894

Re: 11573 - Ocean Currents

kn and rio, thank you for your answers. >kn I used Heap of (Dist, z). But not in C++ STL, I used "homemade" Heap and in Pascal. Maybe I have more complicated representation of graph. >rio Now I know, that my idea was OK. I try to see my code, maybe here are some flaws (wasting of time or infinite lo...
by jurajz
Sun Feb 15, 2009 10:49 am
Forum: Volume 115 (11500-11599)
Topic: 11573 - Ocean Currents
Replies: 12
Views: 3894

11573 - Ocean Currents

I have question about this problem. During the contest, I tried solve it with Dijkstra with binary heap -> TLE. Then I had better idea, using combination BFS and DFS in this way: Initially, in queue1 is only starting point and result =0 and visited[rs,cs]=true (all another points visited[r,c]=false)...
by jurajz
Wed Dec 17, 2008 10:49 pm
Forum: Volume 103 (10300-10399)
Topic: 10366 - Faucet Flow
Replies: 2
Views: 2015

Re: 10366 - Faucet Flow

Thank you for your test cases, Abednego, they are very helpful for me. Especially the sixth one and the last one :)
by jurajz
Fri Dec 05, 2008 1:11 am
Forum: Volume 106 (10600-10699)
Topic: 10644 - Floor Tiles
Replies: 25
Views: 11450

Re: 10644 - Floor Tiles

My AC code gives the same output :)
by jurajz
Mon Nov 24, 2008 7:37 pm
Forum: Volume 106 (10600-10699)
Topic: 10644 - Floor Tiles
Replies: 25
Views: 11450

Re: 10644 - Floor Tiles

My AC code gives: 5348 5348 0 553448 It is hard to say, if it is incorrect. Your input for 1 1000 1 1000 is probably incorrect, but from the other side, problem description says, that L1 L2 W1 W2 are positive integers less than 1000. So, input 1 1000 1 1000 can not be in the input file. Because of t...
by jurajz
Mon Oct 06, 2008 1:22 pm
Forum: Volume 115 (11500-11599)
Topic: 11508 - Life on Mars?
Replies: 7
Views: 3111

Re: 11508 - Life on Mars?

I try compile and run your program and maybe I find, where may be problem. Test case can begin with 0, but here can be more then one number. For this case, your program ends immediately, but you should terminate only when here is single zero. (From input description, program ends when the message is...
by jurajz
Mon Oct 06, 2008 10:37 am
Forum: Volume 115 (11500-11599)
Topic: 11508 - Life on Mars?
Replies: 7
Views: 3111

Re: WA: 11508 - Life on Mars?

It seems, that your algorithm is same as me. Maybe I find one mistake: num = 1; tmp[0] = -1; while(scanf("%d%c",&x,&ch)) { arr[num++] = x; if(ch == '\n')break; } /* added line */ for (i = 0; i < num; i++) tmp[i] = -1; for(x = 0,y = 0; x < num && arr[x] < num; x++) { if(tmp[arr[x]] != arr[x]) { tmp[a...
by jurajz
Sun Jul 27, 2008 9:51 pm
Forum: Volume 114 (11400-11499)
Topic: 11459 - Snakes and Ladders
Replies: 33
Views: 15140

Re: 11459 - Snakes and Ladders

Hi shiplu_1320, I think, that I found a mistake. After this two lines while(lad[pl[j]]!=0) pl[j]=lad[pl[j]]; you should add some more lines. Player can reach position 100 by ladder and after this, the game ends immediately. But you don't check this and you continue with the next roll. Try to fix it....

Go to advanced search