Search found 98 matches

by jpfarias
Sun Jul 06, 2003 5:02 pm
Forum: Volume 105 (10500-10599)
Topic: 10527 - Persistent Numbers
Replies: 26
Views: 11530

I think you need to use some bigint class to solve this, as the number may have 1000 digits...
by jpfarias
Tue Jul 01, 2003 3:28 pm
Forum: Volume 6 (600-699)
Topic: 659 - Reflections
Replies: 12
Views: 5634

Ok, so, can you tell me what is your formula to calculate the resulting angle? And about the point (1,-4) in the first test case, I know it is the direction, so I add it to original point to get the vector, the resulting is a vector starting at (3,8) with endpoint in (4,4), with these 2 points I cal...
by jpfarias
Mon Jun 30, 2003 7:21 pm
Forum: C
Topic: EOF Problem
Replies: 2
Views: 1977

Cause this way scanf doesn't remove the '\n' at the end of line, it just reads until a '\n'.

Here is a corrected version:

Code: Select all

while (scanf("%[^\n]", s) != EOF) {
  /* process  s  here */
  getc(stdin); /* remove the \n */
}
Got it?

JP!
by jpfarias
Mon Jun 30, 2003 6:51 pm
Forum: Volume 101 (10100-10199)
Topic: 10181 - 15-Puzzle Problem
Replies: 36
Views: 19765

Hi, again!

Can you point me with some site with good info on IDA* or A* similar algorithms?

Thanks,

JP!
by jpfarias
Mon Jun 30, 2003 2:20 pm
Forum: Volume 101 (10100-10199)
Topic: 10181 - 15-Puzzle Problem
Replies: 36
Views: 19765

What search do you use?

I'm now using DFS with max depth 46 and it can't solve in time...

JP!
by jpfarias
Mon Jun 30, 2003 12:32 am
Forum: Volume 6 (600-699)
Topic: 659 - Reflections
Replies: 12
Views: 5634

Hi!

Is my formula above correct? If not, can you tell me the correct one?

Thanks,

JP!
by jpfarias
Sat Jun 28, 2003 10:32 pm
Forum: Volume 6 (600-699)
Topic: 617 - Nonstop Travel
Replies: 9
Views: 3780

Try this input / output: Input: 1 5.5 40 8 25 3 10.7 10 2 75 12.5 12 5 57 17.93 15 4 67 0 1 10 1 1 0 1 10 1 1 1 -1 Output: Case 1: 30, 32-33, 36-38, 41-45, 48-54, 59-60 Case 2: No acceptable speeds. Case 3: 30-60 Case 4: 30-60 Case 5: 30-33, 36-37, 40, 43, 45, 47-48, 50-51, 53-57, 59-60 JP!
by jpfarias
Sat Jun 28, 2003 10:22 pm
Forum: Volume 6 (600-699)
Topic: 659 - Reflections
Replies: 12
Views: 5634

The reflect is...

How do you calculate the reflected ray? I'm using this formula: R = V - 2 * ( V . N ) * N Where: R => The resulting ray V => The actual ray N => The normal in the point it hits the circle I've found this formula in a book of algebra. Is this wrong? I'm also reducing the ray to 0.5 * (the normalized ...
by jpfarias
Sat Jun 28, 2003 10:16 pm
Forum: Volume 101 (10100-10199)
Topic: 10181 - 15-Puzzle Problem
Replies: 36
Views: 19765

I think I've get it. I'll try to implement it when I get to linux (I'm using windows right now...)

Thanks a lot for your help!

JP!
by jpfarias
Sat Jun 28, 2003 12:04 am
Forum: Volume 6 (600-699)
Topic: 659 - Reflections
Replies: 12
Views: 5634

I don't know if this is true, but my first attemp on solving this problem give me this answer also. May be someone who got AC can tell us if this is really true or not, or even show us a graphic with the rays / circles... ;)


JP!
by jpfarias
Sat Jun 28, 2003 12:01 am
Forum: Volume 101 (10100-10199)
Topic: 10181 - 15-Puzzle Problem
Replies: 36
Views: 19765

Hi,

I didn't understand very well what you mean. Can you show an example or try to explain it better?

I really don't know how to store only 52 configurations!!! My queue goes as big as 60000 when it reachs the 45-50 steps.

Thanks,

JP!
by jpfarias
Thu Jun 26, 2003 2:04 pm
Forum: Volume 101 (10100-10199)
Topic: 10181 - 15-Puzzle Problem
Replies: 36
Views: 19765

MLE

Hi!

Man, I've tried to solve this one but I'm in trouble...

I've used BFS and hash to store configurations I've seen and I'm getting MLE and some SIGSEGV :(

Can anyone tell me some tips on A* or IDA*, by pointing some sites or even describing the algorithm?

Thanks,

JP!
by jpfarias
Wed Jun 25, 2003 1:31 am
Forum: Volume 101 (10100-10199)
Topic: 10181 - 15-Puzzle Problem
Replies: 36
Views: 19765

Backtrack

Is there a way to solve this problem with backtrack?

What I need to do to avoid repeating states?

Thanks!

JP.
by jpfarias
Thu Jun 19, 2003 4:42 pm
Forum: Volume 3 (300-399)
Topic: 329 - PostScript Emulation
Replies: 6
Views: 2159

Corrected!

Hi!

I finally talked to Carlos and we corrected the output of the judge, and he is rejudging the submissions right now.

I hope people can get AC now. I got :)

PS: He is still trying to make his solution work as good as mine :) (just kidding Carlos).

JP!
by jpfarias
Sun Jun 15, 2003 11:13 pm
Forum: Volume 3 (300-399)
Topic: 326 - Extrapolation Using a Difference Table
Replies: 5
Views: 3314

The DP approach is: 1. Build the nxn difference table (there will some blanks) 2. Copy the last line in the triangle to a vector(just to make things easier), this line has n elements 3. for i = 0 to k-1 do 4. for j=n-2 to 0 do 5. vec[j] = vec[j+1] + vec[j] 6. print vec[0] Hope I've helped, JP!

Go to advanced search