제출 #447464

#제출 시각아이디문제언어결과실행 시간메모리
447464snasibov05Fireworks (APIO16_fireworks)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> p(m), c(m); for (int i = 0; i < m; ++i) cin >> p[i] >> c[i]; sort(c.begin(), c.end()); long long ans = 0; for (int i = 0; i < m; ++i) { ans += abs(c[i] - c[m/2]); } cout << ans << "\n"; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

fireworks.cpp: In function 'int main()':
fireworks.cpp:11:5: error: 'sort' was not declared in this scope; did you mean 'qsort'?
   11 |     sort(c.begin(), c.end());
      |     ^~~~
      |     qsort