Search found 19 matches

by matrix2
Sat Nov 13, 2004 4:03 pm
Forum: Volume 100 (10000-10099)
Topic: 10021 - Cube in the labirint
Replies: 17
Views: 3787

Hi...
I can tell you that moving the cube on the board may be simulated. For the algo, I think a BFS is the solution
by matrix2
Fri Oct 08, 2004 12:39 am
Forum: Volume 107 (10700-10799)
Topic: 10720 - Graph Construction
Replies: 49
Views: 30458

In this problem we are talking about simple graph which does not have same endpoints for more than one edge, and also does not have edges with the same endpoint.
what does it mean?
Is the graph directed?
by matrix2
Thu Oct 07, 2004 3:24 pm
Forum: Volume 100 (10000-10099)
Topic: 10021 - Cube in the labirint
Replies: 17
Views: 3787

Yeeeess...I've solved it. And lastly got AC. 4 ms and 420 k memory. Some explanations: - a cell can be repeated more than once - it is preferably to use a BFS (Bradth First Search) in Labirint: that means you must search in all four directions simultaneously to get to final destination in small amou...
by matrix2
Thu Oct 07, 2004 9:02 am
Forum: Volume 100 (10000-10099)
Topic: 10021 - Cube in the labirint
Replies: 17
Views: 3787

I think that a cell can be repeated. So the input: 1 3 2 1 1 2 2 may give an answer like that: 6 otherwise "No solution". But if I do a DF traversal then I'll get TLE. Here is my DFS code: #include <stdio.h> #include <memory.h> /* die faces */ #define UP 0 #define DOWN 1 #define LEFT 2 #define RIGHT...
by matrix2
Wed Oct 06, 2004 11:20 pm
Forum: Volume 100 (10000-10099)
Topic: 10021 - Cube in the labirint
Replies: 17
Views: 3787

10021 - How to solve?

How can I solve this problem?
I've tried DFS first, then BFS, but WA. It seems a cell can be visited more than once. So it would go for TLE, in't it?
by matrix2
Thu Sep 30, 2004 11:23 am
Forum: Volume 100 (10000-10099)
Topic: 10010 - Where's Waldorf?
Replies: 42
Views: 17720

EVRIKAAAA!

I have found the answer: "A word matches a straight, uninterrupted line of letters in the grid."
by matrix2
Thu Sep 30, 2004 10:32 am
Forum: Volume 100 (10000-10099)
Topic: 10010 - Where's Waldorf?
Replies: 42
Views: 17720

Please help me. Pleaseeeeeeee...Just a word!
by matrix2
Thu Sep 30, 2004 10:23 am
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 38528

Oh... I've forgot
Delete the line
printf("\n")
before while(i<n) from your source code and you'll get a clean AC.
by matrix2
Thu Sep 30, 2004 10:10 am
Forum: Volume 100 (10000-10099)
Topic: 10014 - Simple calculations
Replies: 34
Views: 8287

by matrix2
Mon Sep 27, 2004 12:48 am
Forum: Volume 101 (10100-10199)
Topic: 10101 - Bangla Numbers
Replies: 122
Views: 27331

Thank you very much, tan_Yui.
by matrix2
Sun Sep 26, 2004 10:08 pm
Forum: Volume 100 (10000-10099)
Topic: 10014 - Simple calculations
Replies: 34
Views: 8287

Man man man What happened? Are you new to acm.uva.es problemset? Some key explanations: - this problem requires multiple input - revise your code, see that csum variable is not initialized after first calculation process - the line "printf("%.2f",a1); " must be transformed into "printf("%.2f%s",a1, ...
by matrix2
Sun Sep 26, 2004 2:00 pm
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 38528

Probable you must not put a blank line after last case e.g printf("\n\n").
You can write in this way:

while(i < n)
{
/* ...... */
if(i == n)
printf("\n");
else
printf("\n\n");
}
by matrix2
Sun Sep 26, 2004 1:07 pm
Forum: Volume 100 (10000-10099)
Topic: 10010 - Where's Waldorf?
Replies: 42
Views: 17720

10010 Where the hell is Waldorf? I can't find it!!!

Hye... I am very disappointed. I submitted this problem 20 times and I've got WA for all. Is there some treaky inputs? Please, people, help me with this easy problem. Look a little at my code: #include <stdio.h> #include <ctype.h> int m, n; /* num of line & columns */ char grid[60][60]; char viz[60]...
by matrix2
Sun Sep 26, 2004 1:17 am
Forum: Volume 102 (10200-10299)
Topic: 10299 - Relatives
Replies: 57
Views: 13919

Solved...

Lastly I've solved this problem. I've got TLE because of square() function which was evaluated every step in the for() loop. Also the above code would give WA even if we improve it. Problem solution is easy as PI, because it's pure mathematic: For a number n = p1^a1 * p2^a2 * . . . * pn^an, where p1...
by matrix2
Sat Sep 25, 2004 7:16 pm
Forum: Volume 102 (10200-10299)
Topic: 10299 - Relatives
Replies: 57
Views: 13919

10299 - TLE on good algoritm please help

Hy! I used the clasical algorithm to solve this problem, that means Euler phi function and I still get TLE. I don't know why.. please help me understand why... Here goes my code: #include <stdio.h> #include <math.h> int main(void) { int n, i, phi; while(scanf("%d", &n) == 1) { if(n == 0) break; phi ...

Go to advanced search