fighting_dreamer's blog

By fighting_dreamer, history, 6 years ago, In English

Hi,

I am getting a lot of wrong answers for the "acmguru" section. I tried 987654321 problem problem

my code : ideone-link I got the wrong answer here.

I have 2 fold Issue :

  1. I just wanted to know if there is some issue like the "int" holds till certain range that is different from what I get to use in the usual codeforces contest code.{I usually compile n execute my code via : GNU C++11}

  2. In case this is coz of my mis-interpretation (or otherwise also) then please help me in how to meet the code`s requirements like some problems require "0.25 sec" execution time else they give TLE and usually It seems that it is a O(n^2) or higher problem.

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

your code is wrong for every n >= 9... and for your other questions: first its all normal so ints are 32 bit signed integers as always. and second it shouldn't matter how much time you actuall have just do calculations like: 10^7 operations per second. Than you can easily calculate how much operations you can do in a quater of a second?