Search:

Type: Posts; User: sc7

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    9,393

    I did this too :(. Maybe I am not getting it, but...

    I did this too :(. Maybe I am not getting it, but I tried and I picked up 997. Since M<=5, I don't know which primes to pick. the primes which have their squares less than 997 will give their squares...
  2. Replies
    7
    Views
    9,393

    but , that's not the issue, my problem is with...

    but , that's not the issue, my problem is with guessing the prime number in such a huge range. I don't know which numbers to give the computer and then get x^2%P, I can ask this M times(less than...
  3. Replies
    7
    Views
    9,393

    I am not trying to get my homework done here....

    I am not trying to get my homework done here. Just needed help in a topic which I am weak in. That's why I added in the end to guide me. I have been trying out this problem for quite a while now, and...
  4. Replies
    7
    Views
    9,393

    If anyone could help even for 1st Question, it...

    If anyone could help even for 1st Question, it would be very helpful.
  5. Replies
    7
    Views
    9,393

    Tell the Prime number

    (1st question)
    We need to guess a Prime number between 2 to 10^9(inclusive) in M questions.
    Here's how it works:
    - We can give the computer a number x(1 to 10^9).the computer replies with x^2%P....
  6. Replies
    3
    Views
    3,721

    I see... you have a lot of frustration in your...

    I see... you have a lot of frustration in your life, and since, you are too much of a coward to deal with them, you go online and try to undermine other's work, cool good for you.. and who says...
  7. Replies
    3
    Views
    3,721

    Substring Problem | Optimization needed

    I need some help in solving this substring problem am dealing with, here's the problem:

    Q:
    Find the longest substring in a string(that we input) that contains at least one character who's...
  8. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    can't see whtats the wrong output, online site...

    can't see whtats the wrong output, online site doesn't show that, just correct or wrong, some of my test cases passes but some don't:

    Algo:
    Look for two longest streaks of 1s, for rotation keep a...
  9. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    I am not getting segmentation error now, just the...

    I am not getting segmentation error now, just the implementation is wrong still..some test cases are working perfectly while others giving wrong answer
  10. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    never put it on you dude, instead thanked you....

    never put it on you dude, instead thanked you. cool. good chat.
  11. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    Yes, maybe I don't know C++ ... but isn't what...

    Yes, maybe I don't know C++ ... but isn't what this forum is for, making others understand what you're trying to do, maybe I am a little frustrated and not thinking straight coz I have been banging...
  12. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    I am finding it hard to understand your code, why...

    I am finding it hard to understand your code, why are you inputting bit twice ?? whats init ?? is that checking if array[0] and array[n-1] both have 1s ?what is place function doing ??
    I really...
  13. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    @tabstop, lol, yes thats correct, I finally got...

    @tabstop, lol, yes thats correct, I finally got down and learned how to use a debugger, it helped.
    Still my code is giving some testcases as wrong and some correct...
  14. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    I found the error its in the while loop...

    I found the error its in the while loop
    while(arr[i]==1) //should contain i<n, Still am getting some correct testcases, some wrong, there is still something wrong(with my implementation)
  15. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    What I meant to say is that this could handle...

    What I meant to say is that this could handle large inputs, but don't know if I am going out of bounds somewhere, or something like that ??
  16. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    2 3 3 is the expected output..

    2
    3
    3 is the expected output..
  17. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    I have checked with all 0s all 1s and 101010 , it...

    I have checked with all 0s all 1s and 101010 , it works fine with all in my personal IDE, but shows SIGSEGV error on online one
  18. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    example testcase: 5 5 3 1 1 0 1 1 ?!?!?...

    example testcase:
    5 5 3
    1 1 0 1 1
    ?!?!?
    output:
    2
    3
    3

    The test cases that got segmentation error are not shown,
  19. Thread: Segmentation error

    by sc7
    Replies
    24
    Views
    10,221

    Segmentation error

    Following is the code to a problem I have been doing over course of 1 week , I came close, 1subtask(With huge input) is passing , but other testcases are showing Runtime error(SIGSEGV)(Segementation...
  20. Thread: Need optimization

    by sc7
    Replies
    22
    Views
    7,226

    Sorry for messaging you privately and posting in...

    Sorry for messaging you privately and posting in other's thread, but I was desperate to get my code right I think...
    I did provide proper naming and indentation and the algorithm is already...
  21. Thread: Need optimization

    by sc7
    Replies
    22
    Views
    7,226

    @john.c can you please debug this ??

    @john.c can you please debug this ??
  22. Thread: Need optimization

    by sc7
    Replies
    22
    Views
    7,226

    So I coded the way you told, it did pass the...

    So I coded the way you told, it did pass the limit, but is giving Segmentation fault error, and I can't seem to find the error :(



    int streak_1_head,streak_1_tail,streak_2_head,streak_2_tail;
    ...
  23. Thread: Need optimization

    by sc7
    Replies
    22
    Views
    7,226

    How?? the result is calculated arithmetically, I...

    How?? the result is calculated arithmetically, I need to find the max run of 1's anyhow for each query and check at the end whether it is smaller than or greater than k, and return my result...
  24. Thread: Need optimization

    by sc7
    Replies
    22
    Views
    7,226

    I understand why you are emphasising so much on...

    I understand why you are emphasising so much on the k value, in the beginning, even I thought that the answer is very dependent on k, then realised, no it's an idiotic way to make this problem unique...
  25. Thread: Need optimization

    by sc7
    Replies
    22
    Views
    7,226

    No, please refer to the sample input and output...

    No, please refer to the sample input and output on the page, It clearly tells with an explanation if your array is like [1,1,1,1,0] and k=3, then the largest subsequence, i.e, from i=0 till...
Results 1 to 25 of 33
Page 1 of 2 1 2