Search found 3 matches

by byerlan
Wed May 04, 2005 8:35 am
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 41823

Thank you, but this one works O(1500^2) isn't it. What is the time you got on AC for this task, could you tell me? I wanted to find that with Binary search using F(x). And I did it!!! Thank you. I even didn't think about DP for this question. And I will be able to solve this like question using your ...
by byerlan
Tue May 03, 2005 8:36 am
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 41823

Rezult of F(x) is equal to count of numbers
that are ugly and less or equal to x.
by byerlan
Thu Apr 28, 2005 7:02 am
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 41823

136 - 4e za prikol

:evil:
what is wrong with this function
i want to find how many ugly numbers less or equal to 'x'...

Function F(x : LongInt) : LongInt;
var x2,x3,x5 : LongInt;
cnt,T : Int64;
i,j,k : LongInt;
Begin
x2 := trunc(Ln(x)/Ln(2));
x3 := trunc(Ln(x)/Ln(3));
x5 := trunc(Ln(x)/Ln(5));
cnt := 0;
For i ...

Go to advanced search