Search found 19 matches

by wsarzynski
Sat Nov 08, 2003 5:50 am
Forum: Volume 1 (100-199)
Topic: 115 - Climbing Trees
Replies: 30
Views: 11258

There are inputs with many parents for some nodes.
And input is :evil:
you had a topic on 115 with date Sat Nov 01, 2003 2:13 am,
it is very helpfull
by wsarzynski
Sat Nov 08, 2003 5:46 am
Forum: Volume 1 (100-199)
Topic: 114 - Simulation Wizardry
Replies: 80
Views: 7613

ball uses unit of lifetime for each HIT of bumper,
even if it does not move, it can lose all life just by hitting walls.
answer to your input is
0
0
by wsarzynski
Sat Nov 01, 2003 8:49 pm
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 20480

it is couple of hundreds and, as i said, this does not causes overflow problems with this algorithm. check this: no incorrect rounding in second loop and 1 output number computation - can be done with integer division m must be >= 2 after you check b != 1 check both input numbers are satisfied dont ...
by wsarzynski
Sat Nov 01, 2003 8:06 pm
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 20480

i suppose so:
loop to find m and height, 2 solutions are ok
then just second loop to find height of stack
by wsarzynski
Sat Nov 01, 2003 7:53 pm
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 20480

ok, ok, i sent my solution couple of times and it seems that
max height OF STACK is >= 10 and <= 100 millions
by wsarzynski
Sat Nov 01, 2003 3:39 pm
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 20480

in my solution i also had to change int to unsigned because of overflows,
then got accepted.
check boundary conditions, don't count to much in first loop,
you probably need 2 x if( ... ) break;
haven't noticed any other problems or tricks
by wsarzynski
Sat Nov 01, 2003 3:13 am
Forum: Volume 1 (100-199)
Topic: 115 - Climbing Trees
Replies: 30
Views: 11258

i lost couple of hours, but got Accepted
INPUT IS ...
THERE ARE EMPTY LINES / LINES WITHOUT TWO FULL NAMES

I DON'T LIKE PROBLEMS LIKE THIS !!!!!!!!!!!!!!!!!!!!!! :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil:
by wsarzynski
Sat Nov 01, 2003 1:43 am
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 20480

i handled case second number in pair = 1 separetly.
it seems quite different in my solution.
by wsarzynski
Wed Oct 29, 2003 7:56 pm
Forum: Algorithms
Topic: finding angle between 3 points
Replies: 13
Views: 3695

Hint in 109 says you don't need to compute angles to sort by angles,
it is an optimization issue. I try to avoid angles.
by wsarzynski
Wed Oct 29, 2003 6:25 pm
Forum: Algorithms
Topic: finding angle between 3 points
Replies: 13
Views: 3695

i think you should subtract p2 from both p1 and p3. this should work when p1 p2 p3 counter-clockwise oriented. x1 -= x2; y1 -= y2; x3 -= x2; y3 -= y2; double angle1 = atan2(y1, x1); double angle2 = atan2(y3, x3); if( angle1 < 0.0 ) angle1 += 2*M_PI; if( angle2 < 0.0 ) angle2 += 2*M_PI; return 180.0*...
by wsarzynski
Wed Oct 29, 2003 5:12 pm
Forum: Algorithms
Topic: finding angle between 3 points
Replies: 13
Views: 3695

do you really need this angle ?
i did quite a lot of geometry and inconsistency was never a problem.
Check a hint for problem 109, bottom of problem description,
- detection of orientation.
by wsarzynski
Tue Oct 28, 2003 2:44 am
Forum: Volume 1 (100-199)
Topic: 115 - Climbing Trees
Replies: 30
Views: 11258

i checked this 1 cousin removed 1 vs. 3 cousin case
and it's ok, but i get WA.
what doi printf for graph as in example and query:
a f
by wsarzynski
Tue Oct 28, 2003 1:17 am
Forum: Volume 1 (100-199)
Topic: 115 - Climbing Trees
Replies: 30
Views: 11258

ok, i checked with sigsegv method and there are no such cases.
by wsarzynski
Tue Oct 28, 2003 12:58 am
Forum: Volume 1 (100-199)
Topic: 115 - Climbing Trees
Replies: 30
Views: 11258

i'm confused, help pls.
what should i printf for this case:
d a
e a
d c
c b
e b
no.child no.parent
d e
by wsarzynski
Thu Nov 21, 2002 2:09 am
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 18405

Your solution is really good. Myself, i learned from this problem that judge accepts inline asm in c++. I just used three loops for logarithms and "jo" instruction to detect overflows. I think under-linear complexity algorithm is possible if "easy & dense" subset of ugly numbers exists, ie for numbe...

Go to advanced search