Search found 3 matches
- 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 ...
- Tue May 03, 2005 8:36 am
- Forum: Volume 1 (100-199)
- Topic: 136 - Ugly Numbers
- Replies: 156
- Views: 41823
- 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 ...
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 ...