版本比较
【模板】对拍
正文
增加 8 行删除 8 行
4 行未改动567891011121314151617181920212223242526272829307 行未改动38394041424344454647484950515253544 行未改动signed main() {// std::system("g++ {file}.cpp -o {file} -O2 -static -std=c++14");// std::system("g++ {file}-gen.cpp -o {file}-gen -O2 -static -std=c++14");// std::system("g++ {file}-sol.cpp -o {file}-sol -O2 -static -std=c++14");// std::cerr << "Successfully compiled three cpp.\n";int tc = 0;while (true) {tc += 1;std::system("{file}-gen.exe > {file}.in");std::system("{file}-sol.exe < {file}.in > {file}.ans");int tfrom = clock();std::system("{file}.exe < {file}.in > {file}.out");// int x = std::system("fc P11833.out P11833.ans");int tto = clock();bool flag = false;std::ifstream outin("{file}.out");std::ifstream ansin("{file}.ans");std::string out, ans;while (true) {bool bln = false;bln |= bool(std::getline(outin, out));7 行未改动flag = true;break;}}}if (flag == 0) {std::cerr << "\033[32mAccepted #" << tc << " " << (tto - tfrom) * 1.0 / CLOCKS_PER_SEC << "s " << "\033[0m\n";} else {std::cerr << "\033[31mUnaccepted #" << tc << "\033[0m\n";return 0;}}return 0;}```4 行未改动567891011121314151617181920212223242526272829307 行未改动38394041424344454647484950515253544 行未改动signed main() {// std::system("g++ {file}.cpp -o {file} -O2 -static -std=c++14");// std::system("g++ {file}-gen.cpp -o {file}-gen -O2 -static -std=c++14");// std::system("g++ {file}-sol.cpp -o {file}-sol -O2 -static -std=c++14");// std::cerr << "Successfully compiled three cpp.\n";int tc = 0;while (true) {tc += 1;std::system("{file}-gen.exe > {file}.in");std::system("{file}-sol.exe < {file}.in > {file}.ans");int tfrom = clock();std::system("{file}.exe < {file}.in > {file}.out");// int x = std::system("fc P11833.out P11833.ans");int tto = clock();bool flag = false;std::ifstream outin("{file}.out");std::ifstream ansin("{file}.ans");std::string out, ans;while (true) {bool bln = false;bln |= bool(std::getline(outin, out));7 行未改动flag = true;break;}}}if (flag == 0) {std::cerr << "\033[32mAccepted #" << tc << " " << (tto - tfrom) * 1.0 / CLOCKS_PER_SEC << "s " << "\033[0m\n";} else {std::cerr << "\033[31mUnaccepted #" << tc << "\033[0m\n";return 0;}}return 0;}```