Rating changes for the last round are temporarily rolled back. They will be returned soon. ×

suraj021's blog

By suraj021, 5 years ago, In English,

Your text to link here... Problem with such large integer constraints always scare me during contests. How do i solve it. My solution gets integer overflow. P.S Positive responses are always appreciated. :)

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

C/C++ : try long long or unsigned long long if long long fails.

Python : lol, 10^18 is large ?

Java : long should do the job. For larger, use big integer.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Please have a look at my sol Your text to link here.... It gives TLE for input . :( Input: 2 1 2 3 6 6 14

    • »
      »
      »
      5 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      Lot of errors in your code:

      Firstly, unsigned integers cant be negative

      Secondly, i think you need to optimize your solution more. You have decided to go with the worst case O(n3) solution every time. You do not need to do this.

      Try substituting value of z in all three equations, and get it done in O(n2)

»
19 months ago, # |
  Vote: I like it 0 Vote: I do not like it
  • »
    »
    19 months ago, # ^ |
      Vote: I like it -10 Vote: I do not like it

    LoOLoOoLoL. LMAO. ROFL. Did you even bother to view the problem source? The problem has an id of 11571 whereas your links points to a problem with id 11565.

    • »
      »
      »
      19 months ago, # ^ |
      Rev. 3   Vote: I like it +4 Vote: I do not like it

      I have read the solution, this solution will work for 11571 too. You can check it. :) Actually 11571 is harder version of 11565. 11565 can be easily solved using three nested loops. :) You should read the whole thing before saying anything. I know the problem very well. Looks like you are the one who haven't read what was in the link. ROFL, LMFAO, LoLolOlLLol!

      It looks like that you always try bash someone at comment section with your rudeness. I have seen a lots of your comments. Oh and you got pretty cute contribution too.