MarioYC's blog

By MarioYC, 8 years ago, In English,

I've tried submitting a solution to problem 120J - Minimum Sum : 1350678, 1350695

But I get Idleness limit exceeded on test 1, I tested my code using Custom Test, but it seems to be working Ok, how can I fix this?

 
 
 
 
  • Vote: I like it
  • -9
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +11 Vote: I do not like it

Input and output from files "input.txt", "output.txt"

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

    can you please explain this with an example?

    • »
      »
      »
      5 years ago, # ^ |
      Rev. 3   Vote: I like it +13 Vote: I do not like it
      freopen("input.txt", "r", stdin);
      
      freopen("output.txt", "w", stdout);
      
      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        thanks a lot!

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

        http://codeforces.com/submissions/agupta90# this my submission. can you please point out the problem?

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

          i think it's bcz of getch() call

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

            nope, if i remove it,i'm getting wrong answer on test 1!

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

              why u are printing a[i] in cycle?

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

                thanks again, it was a stupid mistake.now the code is running fine except for the test cases where input values are exceeding the range for "long int".I guess this has to be done in c++ or java