(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

제출 #1118243

#제출 시각아이디문제언어결과실행 시간메모리
1118243vjudge1Skyscraper (JOI16_skyscraper)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; template <typename T> istream &operator>>(istream &in, vector<T> &arr) { for (T &el : arr) { in >> el; } return in; } int main() { constexpr int MOD = 1'000'000'007; int n, l, s, ans = 0; cin >> n >> l; vector<int> a(n); cin >> a; ranges::sort(a); do { s = 0; for (int i = 0; i < n - 1; i++) { s += abs(a[i] - a[i + 1]); } if (s <= l) { ans++; if (ans == MOD) { ans = 0; } } } while (ranges::next_permutation(a).found); cout << ans << '\n'; return 0; }

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

skyscraper.cpp: In function 'int main()':
skyscraper.cpp:20:3: error: 'ranges' has not been declared
   20 |   ranges::sort(a);
      |   ^~~~~~
skyscraper.cpp:34:12: error: 'ranges' has not been declared
   34 |   } while (ranges::next_permutation(a).found);
      |            ^~~~~~