Search found 9 matches

by rieo
Mon Oct 02, 2006 8:22 am
Forum: Volume 107 (10700-10799)
Topic: 10794 - The Deadly Olympic Returns!!!
Replies: 14
Views: 15339

finally, i got acc... the problem is not the precision error...

if distance=sqrt(a*t*t+b*t+c) a.b.c as above
the minimum distance should be sqrt( a(t+b/2a)^2 + ...)
then we consider if a=0 or not,
if a!=0 then choose t=-b/2a
else a==0, it means v1_x==v2_x and v1_y==v2_y and v1_z==v2_z, so b==0 ...
by rieo
Mon Aug 21, 2006 8:23 am
Forum: Volume 107 (10700-10799)
Topic: 10726 - Coco Monkey
Replies: 9
Views: 5914

can anyone explain case2 and case3?
in case 1, i can understand what it means..

but case 2: 10 -> means S=4 M=2 C=5+10=15, right?
15/4=3...3 left 9.. but 3!=M...
C should be 506, isn't it?
506/4=126...2 left 378
378/4=94.....2 left 282
282/4=70.....2 left 210
210/4=52.....2 left 156
156/4=39.....0 ...
by rieo
Thu Aug 17, 2006 6:35 pm
Forum: Volume 107 (10700-10799)
Topic: 10794 - The Deadly Olympic Returns!!!
Replies: 14
Views: 15339

if someone finds the bug, i will be very grateful. thx


#include <stdio.h>
#include <math.h>

typedef struct {
double x, y, z;
} velocity;

int main()
{
int test_case, data=0, time;
double x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4;
double a, b, c, t, dis;
velocity v1, v2;

scanf ("%d ...
by rieo
Thu Aug 17, 2006 7:23 am
Forum: Volume 107 (10700-10799)
Topic: 10794 - The Deadly Olympic Returns!!!
Replies: 14
Views: 15339

thx martin, i have the same answer with you.
it seems my formula is right, too.
if a=0 then T=0, else T= -b/2a
if T<0 then T=0.
I store all input use double.... but still WA.. :cry:
by rieo
Wed Aug 16, 2006 6:47 pm
Forum: Volume 107 (10700-10799)
Topic: 10794 - The Deadly Olympic Returns!!!
Replies: 14
Views: 15339

hi, i have the same problem, and i don't know where is wrong :(

can anyone post some I/O ?

thx.
by rieo
Wed Jul 05, 2006 1:54 pm
Forum: Volume 100 (10000-10099)
Topic: 10042 - Smith Numbers
Replies: 75
Views: 33538

finally i get accept, i found the bug is i use store primes which are <100000
, and when i test the input s, and use s to mod by prime.. if use all the primes < 100000, s still can't be 1, i wrote if (s>prime[10000]) digitsum(s)
and get RE

when i change the code to if (s!=1) the digitsum(s ...
by rieo
Wed Jul 05, 2006 11:16 am
Forum: Volume 100 (10000-10099)
Topic: 10087 - The Tajmahal of ++Y2k
Replies: 3
Views: 2669

i try to solve this problem but get WA, i use formula to get the magic array for 3 types: odd, 4n, 4n+2 and seems good..

is there any critical input i lose?

L=2 print can't

L and S can only use %d?

and every element i printed use %10d ?


Can any ACer reply? thx
by rieo
Tue Jul 04, 2006 11:06 pm
Forum: Volume 100 (10000-10099)
Topic: 10042 - Smith Numbers
Replies: 75
Views: 33538

if my array is : int prime[20000]; and i write a function
int digitsum(unsigned long int a)

then i write
psum+=digitsum(prime );
could make SIGSEGV ?

or unsigned long int s
but s=s%prime or s/=prime
could make SIGSEGV ?

because i test all data from 0 - 10^9 in gcc and all answer is fine

but ...
by rieo
Tue Jul 04, 2006 11:22 am
Forum: Volume 100 (10000-10099)
Topic: 10042 - Smith Numbers
Replies: 75
Views: 33538

about SIGSEGV

hi,

in 10042 smith numbers, i try the all input from other topic and get correct answer use gcc.

but when i submit my code, it gets signal 11 (SIGSEGV). Meaning:
Invalid memory reference

but i don't know in what condition could make this mistake


is there anyone can help me? thx.

Go to advanced search