| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1176767 | ericl23302 | Skyscraper (JOI16_skyscraper) | C++20 | 2096 ms | 328 KiB |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, l; cin >> n >> l;
vector<int> heights(n);
for (int &i : heights) cin >> i;
sort(heights.begin(), heights.end());
int res = 0;
do {
int tot = 0;
for (int i = 0; i < n - 1; ++i) tot += abs(heights[i] - heights[i + 1]);
res += (tot <= l);
} while (next_permutation(heights.begin(), heights.end()));
cout << res << '\n';
return 0;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
