Yes, this is AC.
Why? Becouse std::next_permutation do exactly the same as descripted in the task.
Obviously, the task was implement this function by yourself.
This is not a competition site. Nobody will check whether you cheat. We are here to perpare for the interview. And if task ask to implement function that already exist in std - be sure - it is NOT the check whether you know names of all function in std.
It doesn't mean that you can't use algorithm library at all. Usually (on interview) you can use all other function except this one. Also you can let interviewer know that if he wants you can implement other function by youself too.