## Search found 109 matches

Mon Aug 03, 2009 2:30 pm
Forum: Volume 116 (11600-11699)
Topic: 11645 - Bits
Replies: 9
Views: 4488

### Re: 11645 - Bits

oh thanx.
Now I got accepted
I followed my logic with no changes, but I implemented long numbers in a different way.

<spoiler>

the long number is represented as an array of 3 longs, which is sufficient for this problem

</spoiler>
Mon Aug 03, 2009 12:54 am
Forum: Volume 116 (11600-11699)
Topic: 11645 - Bits
Replies: 9
Views: 4488

### Re: 11645 - Bits

Oh, and by the way, is this i/o correct:

Code: Select all

``````9223372036854775806
Case 1: 142962266571249024962
``````
?
Sun Aug 02, 2009 11:09 pm
Forum: Volume 116 (11600-11699)
Topic: 11645 - Bits
Replies: 9
Views: 4488

### 11645 - Bits

Hi folks. During the latest contest I tried to solve this problem, and even came up with an idea. But unfortunately after implementation, I have realized that fuctions with long numbers are required to solve this problem, as the answer will be too large even for unsigned long long. But when I implem...
Sun Dec 21, 2008 9:26 pm
Forum: Volume 100 (10000-10099)
Topic: 10029 - Edit Step Ladders
Replies: 70
Views: 22700

### Re: 10029 - Edit Step Ladders

mf, man, I thank you so much, with your smart hashing it's accepted even in Pascal
You r truly a guru like it's written below your avatar.
Sun Dec 21, 2008 9:00 pm
Forum: Volume 100 (10000-10099)
Topic: 10029 - Edit Step Ladders
Replies: 70
Views: 22700

### Re: 10029 - Edit Step Ladders

HDIV is your hash map size, right? okay, thanks for the info! I will try to implement it this way..
by the way, should I use STL string or just character arrays if I decide to write in C++?
Sun Dec 21, 2008 7:09 pm
Forum: Volume 100 (10000-10099)
Topic: 10029 - Edit Step Ladders
Replies: 70
Views: 22700

### Re: 10029 - Edit Step Ladders

Hey again. I have implemented hashing, but it doesn't solve my problem - I keep getting TLE (there are 13 of them already)... I am in complete despair... Here is how I do hashing: function getHash (const s: str16): longint; begin getHash := 0; tt := 1; //1, 26, 26^2, 26^3, ..., 26^16 for tti:=1 to l...
Sun Dec 21, 2008 3:28 pm
Forum: Volume 100 (10000-10099)
Topic: 10029 - Edit Step Ladders
Replies: 70
Views: 22700

### Re: 10029 - Edit Step Ladders

and how should an efficient hashing function look like? I have idea only about one which takes many gigabytes of memory...
Sun Dec 21, 2008 3:00 pm
Forum: Volume 100 (10000-10099)
Topic: 10029 - Edit Step Ladders
Replies: 70
Views: 22700

### Re: 10029 - Edit Step Ladders

Will it then pass the time limit?
Sun Dec 21, 2008 2:01 pm
Forum: Volume 100 (10000-10099)
Topic: 10029 - Edit Step Ladders
Replies: 70
Views: 22700

### Re: 10029 - Edit Step Ladders

just laid in bed a little and thought of an improvement. I can use hashing to check if the word is in dictionary within O(1) time, and not within O(log 25000) time. But to hash a string of lowercase chars of length 16, we need 43608742899428874059776 bits of memory, and this is too much. Of course i...
Sun Dec 21, 2008 1:52 pm
Forum: Volume 100 (10000-10099)
Topic: 10029 - Edit Step Ladders
Replies: 70
Views: 22700

### Re: 10029 - Edit Step Ladders

Hey, is there any way to solve this problem with my approach? I get TLE. And my method is as following: read all words from dictionary for each word make all transformations (848 transformations totally for remove, add and insert character, I think) and for each transformed word make a binary search...
Wed Dec 17, 2008 12:05 pm
Forum: Volume 100 (10000-10099)
Topic: 10026 - Shoemaker's Problem
Replies: 82
Views: 36288

### Re: 10026 - Shoemaker's Problem

I thank you, mf. Hope some day I will be able to help you too
By the way, is it possible to solve this problem without sorting?
Tue Dec 16, 2008 4:02 pm
Forum: Volume 100 (10000-10099)
Topic: 10026 - Shoemaker's Problem
Replies: 82
Views: 36288

### Re: 10026 - Shoemaker's Problem

mf , I thank you so much for your quick reply. Now it is clear.. But.. Did you start thinking from that point with "optimal solution" and "exchanging two adjacent jobs in optimal solution"? Because I am still pretty unsure about how to come to these thoughts, though I understand...
Tue Dec 16, 2008 1:40 pm
Forum: Volume 100 (10000-10099)
Topic: 10026 - Shoemaker's Problem
Replies: 82
Views: 36288

### Re: 10026 - Shoemaker's Problem

Hi guys!
I understand the method of solving this problem: sorting by ratio.
But I have global question: why it works?..
Sun Dec 14, 2008 2:54 pm
Forum: Volume 8 (800-899)
Topic: 843 - Crypt Kicker
Replies: 51
Views: 27273

### Re: 843 - Crypt Kicker

oh, and also a question. for example if we have line of input like this: __crhhi___ (where "_" stands for usual space) should we output: __hello___ or just hello thank you!! or if you don't want to waste your time on explaining to me, you can send your working .exe or maybe source code to ...
Sun Dec 14, 2008 2:51 pm
Forum: Volume 8 (800-899)
Topic: 843 - Crypt Kicker
Replies: 51
Views: 27273

### Re: 843 - Crypt Kicker

Hey! I really don't understand the reason of my WRONG ANSWER... I coded my solution both in C++ and Pascal and it fails at ~0.110 sec. My solution is backtracking with optimizations. It passes the big test from Waterloo within 1 second, so it is time-efficient. I think the reason is in empty-lines h...