## Search found 23 matches

Sun Aug 05, 2007 11:05 pm
Forum: Volume 7 (700-799)
Topic: 705 - Slash Maze
Replies: 13
Views: 10938
I got AC today, but with 8.889 seconds. I guess this would get TLE in competition, is that right? To find a cycle, I do the following: 1. I flood fill the region beginning at some position and count the numbers of squares = numberOfElements; 2. I flood fill again, but this time I check if next squar...
Sun Aug 05, 2007 10:47 pm
Forum: Volume 7 (700-799)
Topic: 705 - Slash Maze
Replies: 13
Views: 10938
The tests posted by jaywinyeah:

Code: Select all

``````0 1

1 0
``````
aren't tested by the judge. The problem statement says that w, h are in the range [1, 75].
Sat Aug 04, 2007 11:10 pm
Forum: Volume 7 (700-799)
Topic: 705 - Slash Maze
Replies: 13
Views: 10938
I represent the maze using 3x3 divisions for each slash mentioned above. But I got stuck in how to get the cicles. In order to find the cycles, I do the following: maxLength=-1; for(i=0; i<3*h; i++) for(j=0; j<3*w; j++){ floodfill(i, j); if(foundACycle==true){ ans++; if(cycleLength>maxLength) maxLen...
Sat Aug 04, 2007 1:27 am
Forum: Volume 102 (10200-10299)
Topic: 10209 - Is This Integration ?
Replies: 37
Views: 12086
Thank you tgoulart! I got AC today! =D I was misusing the integral. I saw yor third figure and I figured out my error. With your third picture I got te third equation. I'll explain how I solve this problem, since the equations given in previous codes in this forum are too hard to understand. Let's c...
Thu Aug 02, 2007 2:59 pm
Forum: Volume 102 (10200-10299)
Topic: 10209 - Is This Integration ?
Replies: 37
Views: 12086
I tried to get the equations above but I coudn't. I get 2 equations with 3 variables and I can't find the third one, to solve the system. So, I tried to integrate the equation sqrt(a^2 - x^2) + a, in the range (0, a/2), in order to get half of the square-lined area. After this integration, the formu...
Thu Jul 26, 2007 7:27 pm
Forum: Volume 101 (10100-10199)
Topic: 10154 - Weights and Measures
Replies: 60
Views: 39814
I did this problem using LIS but I get WA. I saw on board that LIS/Greedy based solutions don't work anymore. Could someone that solved this problem using another approach tell me some hints?
Thank you!
Tue Jul 24, 2007 6:21 am
Forum: Volume 8 (800-899)
Topic: 825 - Walking on the Safe Side
Replies: 38
Views: 20153
My solution to this problem run in 0.000 s and I didn't use DP. I just use a matrix to represent the streets and traverse it recursevely, counting a way everytime that it reaches the extreme point. int ans=0; int p[MAX][MAX]; void coutWays(int x, int y){ //if it reaches the station if(x==l && y==c){...
Sun Oct 29, 2006 12:03 am
Forum: Volume 111 (11100-11199)
Topic: 11140 - Little Ali's Little Brother!
Replies: 28
Views: 13925
little joey, My code is just like yours. In my function piece_fits_board() I do it justlike in a problem called "Graphical Editor". I traverse the board recursevely looking for a place to fit the piece. I search in all board, where there exists '*'. I've tested all cases in this forum and my program...
Sat Oct 28, 2006 2:47 am
Forum: Volume 111 (11100-11199)
Topic: 11140 - Little Ali's Little Brother!
Replies: 28
Views: 13925
please someone help me. I don't know what's wrong with my code. :-( I'm getting crazy... I also considered diagonals... I wasn't doing that before. #include<stdio.h> #include<string.h> #define MAX 50 + 1 + 1 int numCasos, N, M, S, n, m, cont, total; char grid[MAX][MAX], bloco[MAX][MAX], visitado[MAX...
Fri Oct 27, 2006 11:54 pm
Forum: Volume 111 (11100-11199)
Topic: 11140 - Little Ali's Little Brother!
Replies: 28
Views: 13925
What about of the following input:

1
3 6 1
......
......
......
3 3
...
...
...

What would be the output? Yes or No?
Fri Oct 27, 2006 10:40 pm
Forum: Volume 111 (11100-11199)
Topic: 11140 - Little Ali's Little Brother!
Replies: 28
Views: 13925
Thank you little joey. Could you give me some input/output examples?

Thx.
Fri Oct 27, 2006 9:28 pm
Forum: Volume 111 (11100-11199)
Topic: 11140 - Little Ali's Little Brother!
Replies: 28
Views: 13925
I did this problem but I keep getting WA. Could someone give some tricks inputs and outputs?
Can a piece be disconnected? I mean:
...*****..
..........
..........
....***...
?
Fri Oct 20, 2006 8:02 pm
Forum: Volume 100 (10000-10099)
Topic: 10023 - Square root
Replies: 121
Views: 26886
Hi!
Try to use the function memset. It is very fast to initialize arrays of chars. More information at http://www.cppreference.com/stdstring/memset.html
Hope it helps!
Thu Aug 31, 2006 10:11 pm
Forum: Volume 101 (10100-10199)
Topic: 10180 - Rope Crisis in Ropeland!
Replies: 39
Views: 21302
I used the same approach and I got AC.
Thu Aug 31, 2006 4:27 pm
Forum: Volume 101 (10100-10199)
Topic: 10180 - Rope Crisis in Ropeland!
Replies: 39
Views: 21302

### WA

Hi!
Could someone give me some input/output for this problem?