Search found 55 matches

by alu_mathics
Tue Mar 09, 2004 2:53 pm
Forum: Volume 102 (10200-10299)
Topic: 10235 - Simply Emirp
Replies: 150
Views: 31997

An Emirp (Prime spelt backwards) is a Prime that gives you a different Prime when its digits are reversed.
So
11 is not emirp.
You can use seive method.This will help u a lot.
by alu_mathics
Tue Mar 09, 2004 2:48 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 32309

Multiple inputs are of the following form Example: 3 100 1011 11231 3990 34 313 43 ---- test case number. blankline block of input1 blank line block of input2 blank line block of input3 you can read this as: gets(str); test=atol(str);//sscanf(str,"%d",&test); gets(str); while(test--) { while(gets(st...
by alu_mathics
Tue Mar 09, 2004 2:34 pm
Forum: Volume 104 (10400-10499)
Topic: 10450 - World Cup Noise
Replies: 42
Views: 20212

I think what you generate ,its an approximate value of fibo n.
You can use the general recursive formula.
that is
fibo[n]=fibo[n-1]+fibo[n-2];
Hope this will help you
by alu_mathics
Tue Mar 09, 2004 2:22 pm
Forum: Volume 1 (100-199)
Topic: 191 - Intersection
Replies: 103
Views: 18974

remember that in this problem
xtop<=xbottom
ytop>=ybottom
are not always true.
so you should consider this case.
Hope this will help you.
by alu_mathics
Mon Mar 08, 2004 2:57 pm
Forum: Volume 101 (10100-10199)
Topic: 10100 - Longest Match
Replies: 95
Views: 21350

1. Length of longest match: 4
2. Length of longest match: 2
by alu_mathics
Mon Mar 01, 2004 1:05 pm
Forum: Volume 104 (10400-10499)
Topic: 10419 - Sum-up the Primes
Replies: 51
Views: 17200

10419 why wa

I use backtracking for this problem.But it's getting WA.Is the following outputs are correct: input: 32 3 79 1 79 2 79 3 79 4 1000 1 100 2 1000 2 1000 3 1000 4 1000 5 1000 6 1000 8 1000 9 1000 13 999 13 998 13 47 5 91 4 140 6 199 13 267 11 301 5 444 7 611 9 789 11 921 5 1000 14 500 13 17 1 9 3 147 3...
by alu_mathics
Sun Feb 01, 2004 8:50 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 22459

convert ur unsigned long data 2 long long(%lld).
use double instead of float.
And finally change
int value = (int)(input_number*20+0.4);
to
int value = (int)(input_number*20+0.5);//silly but works
u will get ur code P.E. :wink:
by alu_mathics
Fri Jan 30, 2004 9:15 pm
Forum: Volume 4 (400-499)
Topic: 409 - Excuses, Excuses!
Replies: 63
Views: 9225

see the input

thanks 2 LAZ boy.
ur sample input is truely helpful for the problem. :roll:
It's like hidden truth in the sample input . :lol:
by alu_mathics
Wed Jan 28, 2004 1:53 pm
Forum: Volume 100 (10000-10099)
Topic: 10000 - Longest Paths
Replies: 160
Views: 37160

i thing bfs is sufficient for this problem.
i solved the problem using bfs.
if i visit from u 2 v,
then i considered whether d[v]>d+1.
if yes i just update it.
and finally checked which index contains the maximum distance.
thats all.
:lol:
by alu_mathics
Wed Jan 28, 2004 12:26 pm
Forum: Volume 100 (10000-10099)
Topic: 10069 - Distinct Subsequences
Replies: 26
Views: 13477

10069 why TLE || run time error

i don't know why my code gets tle or runtime error.
i just check all the combination and print the number.
2 avoid tle i set some condition ,but then got runtime error.
i don't know why.
need some sample input .
thks in advance

Go to advanced search