1. It calculates fib(n) mod 1000000007.
2. Calculates square and do the mod 1000000007.
3. Now my calculations look like this: ((fib(n) mod 1000000007)*(fib(n) mod 1000000007)) mod 1000000007
...
Type: Posts; User: paut
1. It calculates fib(n) mod 1000000007.
2. Calculates square and do the mod 1000000007.
3. Now my calculations look like this: ((fib(n) mod 1000000007)*(fib(n) mod 1000000007)) mod 1000000007
...
Hi. Can somebody tell me where the solution is wrong?
The task: http://img338.imageshack.us/img338/8097/task.png
My solution: Ideone.com | Online C++ Compiler & Debugging Tool
PS. I use...
Hey, I wonder which data structure I should use to have faster transferring of letters in string.
For example : I've got two words „GHIJ” and „IGHJ” and my job is changing adjacent letters in...
Well.. It is so much faster solution, I implemented it and my program passed all the tests (5/5). Thank you so much for help. I just had to make small correction in code which you wrote for me....
I'm still not able to understand it. For example, if I've got the word ''show slow'' what range this array should have? "For each letter in str2, set str2_letters[str2[i]] = 1 ", this sentences shows...
Thank you for precisely explanation ;) but still I've got problem "Create an array str2_letters[1<<CHAR_BITS]" - What's char_bits?
At first glance it seems that is just lenght of str2, but it...
Ok. So this is how my solution of this problem looks:
Until j is less than lenght of str2 do :
1) Positions of letter from str1 in string str2 assign to p (p=str1.find_first_of(str1[j])
2) If...
1. I don’t know how much it is slow. Well it's just too slow.
2. I'm testing this program on a special website, which has its own input and only rates that the output is correct and gives the time...
Hey, I’ve got problem. I have 2 strings and I want to delete the first occurring of characters from str1 which are in str2. For example:
Str1: show
Str2: slow
Output: h
Str1: expensive
...