Search found 70 matches

by Timo
Mon Jul 09, 2007 3:48 am
Forum: Volume 112 (11200-11299)
Topic: 11234 - Expressions
Replies: 15
Views: 7102

Please remove your code if it can get AC after clean the queue ^_^.
by Timo
Mon Jul 09, 2007 3:02 am
Forum: Volume 112 (11200-11299)
Topic: 11235 - Frequent values
Replies: 35
Views: 15732

Think about Range Maximum Query(RMQ), then you can answer each query in O(lg N) operation after O(N lg N) for build the tree. You must transform the problem to RMQ first ^_^. O(n log n) preprocessing -> O(log n) query answering? If you use binary trees, I think the preprocessing part is O(n) not O(...
by Timo
Sun Jul 08, 2007 9:05 am
Forum: Volume 112 (11200-11299)
Topic: 11235 - Frequent values
Replies: 35
Views: 15732

898989 wrote:Hi
Can any one describe efficient algorithm for the problem that will pass the system tests.
Think about Range Maximum Query(RMQ), then you can answer each query in O(lg N) operation after O(N lg N) for build the tree. You must transform the problem to RMQ first ^_^.
by Timo
Tue Jan 30, 2007 8:33 am
Forum: Algorithms
Topic: Equation
Replies: 7
Views: 2814

Thanks for DP and Darko :D .
by Timo
Mon Jan 29, 2007 12:30 pm
Forum: Algorithms
Topic: Equation
Replies: 7
Views: 2814

Equation

I only know the value of A and N, how to solve this equation:

(A^X) % N == 1

I must compute the value of X.
(2<=A,N<=1000000000).

Thanks

Timo
by Timo
Mon Oct 23, 2006 5:24 pm
Forum: Volume 111 (11100-11199)
Topic: 11138 - Nuts and Bolts
Replies: 9
Views: 5363

Thanks for help me :D
I have got AC...

Timotius Sakti
by Timo
Mon Oct 23, 2006 7:06 am
Forum: Volume 111 (11100-11199)
Topic: 11138 - Nuts and Bolts
Replies: 9
Views: 5363

sorry I have post wrong title :oops:
I am asking for 11138 - Nuts and Bolts

Please forgive me moderator :D
by Timo
Mon Oct 23, 2006 7:01 am
Forum: Volume 111 (11100-11199)
Topic: 11138 - Nuts and Bolts
Replies: 9
Views: 5363

11138 - Nuts and Bolts

I have stuck to solve this problem :( .
Can anybody tell me how to solve this problem ?

Thanks

Timotius Sakti
by Timo
Thu Oct 19, 2006 4:08 am
Forum: Algorithms
Topic: how to choose the num ???
Replies: 13
Views: 4215

Planeyang wrote:sorry about my careless.
Thank you misof and Timo

The Program of Timo is really cool!
That's a very good idea.
the idea was come from misof :D
by Timo
Wed Oct 18, 2006 5:46 am
Forum: Volume 9 (900-999)
Topic: 902 - Password Search
Replies: 68
Views: 31739

Re: 902 Password Search

I think your implementation of Hashtable is wrong. I have use Hashtable too.. and it give me AC I used Rabin Karp method for hashing but it gave me a WA what is your method? sorry for late reply... I used my own method to solve this problem ^ ^ (that's secret), but if you have used Rabin Karp it sh...
by Timo
Wed Oct 18, 2006 5:27 am
Forum: Algorithms
Topic: how to choose the num ???
Replies: 13
Views: 4215

freq = 0

while read number
if freq == 0 then answer = number
else
if number == answer then freq=freq+1
else freq=freq-1
end while

output answer
by Timo
Fri Oct 13, 2006 11:23 am
Forum: Algorithms
Topic: Joke with Turtles
Replies: 0
Views: 1300

Joke with Turtles

Can anybody give me hint to solve this problem.

http://acm.zju.edu.cn/show_problem.php?pid=2667

Thanks

Timotius Sakti
by Timo
Fri Oct 06, 2006 11:15 am
Forum: Bugs and suggestions
Topic: 913 - Output File Wrong
Replies: 4
Views: 2217

I am very very agree with Jan.
I am sure that the judge's output is wrong.
by Timo
Sat Sep 30, 2006 3:01 pm
Forum: Volume 9 (900-999)
Topic: 902 - Password Search
Replies: 68
Views: 31739

Darko wrote:I used java.util.Hashtable, I don't have my own.

So, that's the only way to solve it? I guess I'll have to reinvent yet another wheel :(
don't store the substring in the hashtable, just store the value....

26^10 < 10^18

I hope you understand....


:D
by Timo
Sat Sep 30, 2006 9:11 am
Forum: Volume 9 (900-999)
Topic: 902 - Password Search
Replies: 68
Views: 31739

Re: 902 Password Search

Darko wrote: Oh, I did try using Hashtable, but it gives me MLE - it is just too expensive to use (on UVa, at least).
I think your implementation of Hashtable is wrong.
I have use Hashtable too.. and it give me AC

Go to advanced search