tom's blog

By tom, 10 years ago, In English

http://codeforces.net/gym/100460/problem/E

My idea for this problem is:
For every i I compute x = LCM(LCM(1...i-1), LCM(i+1...n)) (I've got these values from preprocessing) and check if x%t[i] == 0 and x > 10e9.

I have no idea what is wrong, but I keep getting WA on test #6.

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

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

Overflow maybe?

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

    Is my idea OK?

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

      As far as I remember, it should be.

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

        Yeah, I got AC. I've been printing (x-m)%x as result incorrectly. Thanks.