I'm getting internal error in MAR task (submissions 1478507, 1478517, 1478526) , what does it mean ?
This means that judge crushed. Actually I don't know what caused it. Possibly, there was overflow.
can anyone fix this "internal error" ? (it seems that task 4 is problematic )
I think you have actually time limit error. Your algorithm isn't efficient. The problem is solvable in O(n) time if the input is n, this is optimal.