Update perfect.cpp