실행 실패 (제출 코드 컴파일 에러)
Main.cpp: In function ‘int main()’: Main.cpp:17:78: error: a function-definition is not allowed here before ‘{’ token 17 | bool compareBySecond(const pair<int, string>& a, const pair<int, string>& b) { | ^ Main.cpp:34:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::pair<int, std::__cxx11::basic_string<char> > >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 34 | for (int x=0; x<vec.size(); x++){ | ~^~~~~~~~~~~ Main.cpp:36:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::pair<int, std::__cxx11::basic_string<char> > >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 36 | for(int y=x; y<vec.size(); y++){ | ~^~~~~~~~~~~ Main.cpp:37:16: error: expected ‘(’ before ‘vec’ 37 | if vec[y].first=vec[x].first{ | ^~~ | ( Main.cpp:42:46: error: ‘compareBySecond’ was not declared in this scope 42 | sort(vec.begin()+x, vec.end()+x+cnt, compareBySecond); | ^~~~~~~~~~~~~~~ Main.cpp:46:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::pair<int, std::__cxx11::basic_string<char> > >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 46 | for (int x=0; x<vec.size(); x++){ | ~^~~~~~~~~~~ Main.cpp:50:6: error: expected ‘}’ at end of input 50 | } | ^ Main.cpp:7:12: note: to match this ‘{’ 7 | int main() { | ^
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.