Correct complexity class for calculation algorithm