Search found 11 matches

by Evan Tsang
Wed Dec 14, 2005 11:44 am
Forum: Volume 1 (100-199)
Topic: 105 - The Skyline Problem
Replies: 160
Views: 26648

Looks like you have a space after the last 0.
by Evan Tsang
Sun Jan 23, 2005 6:07 am
Forum: Volume 5 (500-599)
Topic: 545 - Heads
Replies: 67
Views: 43375

Beside this bug, You may have a precision problem too Your program output 2^-14 = 6.103E-5 [evan@enigma 545] $ bc -l bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 2^-14 .0000610351562500000...
by Evan Tsang
Sun Jan 23, 2005 5:59 am
Forum: Volume 5 (500-599)
Topic: 545 - Heads
Replies: 67
Views: 43375

Try n = 137,138,6461,

your program output
2^-137 = 5.73:E-42
2^-138 = 2.86:E-42
2^-6461 = 1.10:E-1945
by Evan Tsang
Wed Jan 19, 2005 11:25 am
Forum: Volume 8 (800-899)
Topic: 884 - Factorial Factors
Replies: 49
Views: 26323

I got accepted, not good speed also. Maybe it's because I precalculate all the solutions

I use a modifiication of sieve and calculate the number of terms as it goes.
Then for all i, calculate all the sum of terms[2] to terms..

I have the answer[] arrays before I even start reading the input.
by Evan Tsang
Mon Jan 17, 2005 4:02 am
Forum: Volume 8 (800-899)
Topic: 868 - Numerical Maze
Replies: 21
Views: 14382

868 - Numerical Maze

Can a path reuse a visited position?

Code: Select all

1 X X X
1 X X X
2 3 1 X
1 X 2 X
X X 3 4
Is this a valid path?

-evan
by Evan Tsang
Mon Jan 17, 2005 2:31 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 35770

Check your pile_onto() function. Try this input 24 pile 0 over 23 pile 1 over 23 pile 2 over 23 pile 3 over 23 pile 4 over 23 pile 5 over 23 pile 6 over 23 pile 7 over 23 pile 8 over 23 pile 9 over 23 pile 10 over 23 pile 11 over 23 pile 12 over 23 pile 13 over 23 pile 14 over 23 pile 15 over 23 pil...
by Evan Tsang
Tue Jan 04, 2005 11:15 am
Forum: Volume 2 (200-299)
Topic: 294 - Divisors
Replies: 91
Views: 23006

You got division by zero in this line while(j%primes[pm]==0)
by Evan Tsang
Mon Jan 03, 2005 2:07 am
Forum: C++
Topic: compile error, bzero
Replies: 1
Views: 1684

This function is deprecated -- use memset in new programs.
by Evan Tsang
Mon Jan 03, 2005 1:55 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 176593

program problem_100; var N1,N2,count,solve1:longint; mass1,mass2,mass3:array[1..100] of longint; function Solve(N,k:longint):longint; var i,j,res:longint; begin solve1:=0; FOR j:=n TO k DO begin i:=j; Res:=0; while i>1 do begin if odd(i) then i:=i*3+1 else I:=I div 2; Inc(res); end; if res>solve1 t...
by Evan Tsang
Mon Jan 03, 2005 1:37 am
Forum: Volume 6 (600-699)
Topic: 612 - DNA Sorting
Replies: 122
Views: 15258

Your sorting part is incorrect.

Try this case
2 3
TG
CA
AA

Answer should be
AA
TG
CA
by Evan Tsang
Sun Jan 02, 2005 9:19 am
Forum: Volume 6 (600-699)
Topic: 612 - DNA Sorting
Replies: 122
Views: 15258

Maybe it's because you print a blank line after the last solution.

Go to advanced search