Search:

Type: Posts; User: paut

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    2,202

    1. It calculates fib(n) mod 1000000007. 2....

    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
    ...
  2. Replies
    3
    Views
    2,202

    Fibonacci sequence

    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...
  3. Replies
    2
    Views
    892

    What kind of data structure I should to 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...
  4. Replies
    11
    Views
    1,732

    Well.. It is so much faster solution, I ...

    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....
  5. Replies
    11
    Views
    1,732

    I'm still not able to understand it. For example,...

    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...
  6. Replies
    11
    Views
    1,732

    Thank you for precisely explanation ;) but still...

    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...
  7. Replies
    11
    Views
    1,732

    Ok. So this is how my solution of this problem...

    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...
  8. Replies
    11
    Views
    1,732

    1. I don’t know how much it is slow. Well it's...

    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...
  9. Replies
    11
    Views
    1,732

    Faster way of deleting characters

    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
    ...
Results 1 to 9 of 9