Search found 30 matches

by Amir Aavani
Thu Jun 01, 2006 10:03 am
Forum: Pascal
Topic: hello
Replies: 4
Views: 13010

What is your problem?
by Amir Aavani
Mon Apr 03, 2006 10:59 am
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 68632

I think your program get SigSeg somewhere and so, it got TLE. Try to replace memset with a for loop which set all the elements of an array. I am not sure about how memset in C/C++ do.
by Amir Aavani
Thu Mar 30, 2006 9:58 am
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 68632

try to change
char lCase1[1001] = {0,};
char lCase2[1001] = {0,};
In checkMap, you go till a 0 is meeted, what if the inputs string's length are exactly 1000. you missed the trailing 0.
by Amir Aavani
Thu Mar 30, 2006 9:20 am
Forum: Other words
Topic: Dynamic Programming (a tough one)
Replies: 2
Views: 2484

Let T(n,s) be the number of cases in which sum of n numbers (all less than 10) are eqaul to S. It is not hard to find a recursive descripton for T(n+ 1,s). Let T(n,s) be the number of cases in which sum of n numbers (all less than 10) are eqaul to S and the first number is non-zero. T'(n,s) can be e...
by Amir Aavani
Tue Mar 28, 2006 1:06 pm
Forum: Volume 102 (10200-10299)
Topic: 10299 - Relatives
Replies: 57
Views: 19844

one of your code problem is that num must be longint,
because, the problem states that n<1000000000.
by Amir Aavani
Sat Nov 13, 2004 3:40 pm
Forum: Volume 102 (10200-10299)
Topic: 10212 - The Last Non-zero Digit.
Replies: 63
Views: 38914

dear Riyad I dont think your code has any chance for getting accepted :wink: becuase you want to avoid having 0 by using , mult=mult%100000; which when i> 100000 , for example i=1000000> 20000000 then mult will be 0 and ... also in your while where x= mult%10, i cant understand why you use a loop, ?...
by Amir Aavani
Sun Jul 04, 2004 6:14 am
Forum: Volume 101 (10100-10199)
Topic: 10146 - Dictionary
Replies: 8
Views: 5081

hi every one.
could you please tell me what is output for the following input
1

a
ab
abc
abd
abcd

is it
a
.ab
..abc
..abd
..abcd

or

a
.ab
..abc
..abd
...abcd <-

thanks
Amir
by Amir Aavani
Sat Jun 05, 2004 6:32 am
Forum: Volume 101 (10100-10199)
Topic: 10162 - Last Digit
Replies: 21
Views: 10620

hi dear i afraid your program has problem with n> 100. that is correct that i^i= (i+ 100)^ (i+ 100) but note that you want to calculate the sum of this numbers. so i think you must at first find the last digit of (n div 100) (call it as a) and also n mod 100 (and call it as b). and let c and d be c:...
by Amir Aavani
Wed Jun 02, 2004 9:10 am
Forum: Volume 101 (10100-10199)
Topic: 10139 - Factovisors
Replies: 80
Views: 38732

dear htl
consider the case where m has a prime factor which is bigger than Sqrt (2^31).
i think in these cases your code is wrong
by Amir Aavani
Tue Jun 01, 2004 8:00 am
Forum: Pascal
Topic: How to configure RHIDE to use fpc!
Replies: 1
Views: 5779

How to configure RHIDE to use fpc!

hi to all pascal lover! I looking for an IDE in linux to compile and and debug my pacal programs. I searched a lot but I can't find anything usefull except one IDE in FreePascal home page. but I can't compile it because it needs to a unit that isn't available for public. After sometime I found RhIDE...
by Amir Aavani
Tue May 18, 2004 1:50 pm
Forum: Volume 101 (10100-10199)
Topic: 10140 - Prime Distance
Replies: 17
Views: 9280

hi

if you read the problem more carefully, you can see that the problem says , |L- U|< 1000000.
i means that you must do Sieve of Eratosthenes on an array with maximum length of 1000000.
by Amir Aavani
Mon May 10, 2004 9:24 am
Forum: Volume 101 (10100-10199)
Topic: 10190 - Divide, But Not Quite Conquer!
Replies: 105
Views: 34630

may be your problem is in log function ( i mean that floating point error). why you don't devide a by n in your while and check if new a is a devisor of n. something like this: i:= 0; while (a mod n= 0) do begin Inc (i); No := a div n; a:= a div n; end; if a= 1 then for i:= 1 to i do Write (No ) els...
by Amir Aavani
Sun Apr 11, 2004 9:13 pm
Forum: Volume 100 (10000-10099)
Topic: 10044 - Erdos Numbers
Replies: 102
Views: 52169

Dear Shamim
As I know there is n't any polynominal time alg for graph vertex coloring,
and this problem could be converted to a vertex coloring problem!!
I cant understand what do you mean by an alg les than O (n2).
by Amir Aavani
Tue Apr 06, 2004 8:28 am
Forum: Volume 100 (10000-10099)
Topic: 10021 - Cube in the labirint
Replies: 17
Views: 5473

Dear Adrian Kuegel
I think I solve the problem correctly but getting WA.
I want to know what is the lower point of the board. is it (0, 0) or (1, 1) or no limit?
thnx
by Amir Aavani
Sat Apr 03, 2004 7:59 am
Forum: Pascal
Topic: can i use class in my programs
Replies: 1
Views: 5626

can i use class in my programs

hi to all,
i want to know if there is any object pascal compiler in linux.
as you know BP 7.0 supports object pascal and we can define class in it.
i search the web but i cant find anything (maybe because of wrong keyword in search).
thanks for your help.

Go to advanced search