제출 #1149566

#제출 시각아이디문제언어결과실행 시간메모리
1149566Perl32Road Construction (JOI21_road_construction)C++17
컴파일 에러
0 ms0 KiB
//I wrote this code 4 u <3 #include <bits/stdc++.h> using namespace std; using ll = long long; #ifdef LOCAL #include "algo/debug.h" #else #define debug(...) 42 #endif signed main(int32_t argc, char *argv[]) { ios_base::sync_with_stdio(false); cin.tie(nullptr); ll n, k; cin >> n >> k; vector<pair<ll, ll>> a(n); for (auto& [x, y] : a) cin >> x >> y; vector<ll> srt; auto dst = [&](ll i, ll j) { return abs(a[i].first - a[j].first) + abs(a[i].second - a[j].second); }; for (ll i = 0; i < n; ++i) { for (ll j = i + 1; j < n; ++j) { srt.push_back(dst(i, j)); } } ranges::sort(srt); for (ll i = 0; i < k; ++i) cout << srt[i] << '\n'; } /* */

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

road_construction.cpp: In function 'int main(int32_t, char**)':
road_construction.cpp:30:5: error: 'ranges' has not been declared
   30 |     ranges::sort(srt);
      |     ^~~~~~