pb_matrix's blog

By pb_matrix, 9 hours ago, In English

The problem is 1349A - Orac and LCM My idea is: for a prime p, if the highest power divisible by p are stored in vector for all n numbers, LCM contribution due to this is max(2 numbers we are considering),so if we have <=n-2 numbers, we will get a 0( as max(0,0)=0) and hence gcd contribution because of this p is 1

Can anyone say reason why this is failing 301339390

  • Vote: I like it
  • +2
  • Vote: I do not like it

»
8 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Well your logic is correct. The problem with your code is that when counts.size() is exactly n-1 then min1 = 0 automatically. Think about it. You already get a min of all as 0 as it's not present for all n. Just added that and got AC

  • »
    »
    8 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thankss